bool SIDInfo::getMute() { if (!hasMute || !_sid) return false; snd_mixer_elem_t* elem = snd_mixer_find_selem(_handle, _sid); if (!elem) return false; int swr, swl; snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, &swl); snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_RIGHT, &swr); return !(swl || swr); }
static gboolean alsa_mixer_is_muted(snd_mixer_elem_t *elem, gboolean *need_reset) { int sw; long Rvol, Lvol, min, max; if(need_reset) *need_reset = FALSE; /**if switch is available, get switch status directly*/ if(snd_mixer_selem_has_playback_switch(elem)) { snd_mixer_selem_get_playback_switch(elem, 0, &sw); return sw ? FALSE: TRUE; } else if(snd_mixer_selem_has_capture_switch(elem)) { snd_mixer_selem_get_capture_switch(elem, 0, &sw); return sw ? FALSE: TRUE; } if(snd_mixer_selem_has_playback_volume(elem)) { snd_mixer_selem_get_playback_volume(elem, 0, &Rvol); snd_mixer_selem_get_playback_volume(elem, 1, &Lvol); snd_mixer_selem_get_playback_volume_range(elem, &min, &max); if(need_reset) *need_reset = !!(max - Rvol); return (Rvol + Lvol) ? FALSE: TRUE; } else if(snd_mixer_selem_has_capture_volume(elem)) { snd_mixer_selem_get_capture_volume_range(elem, &min, &max); snd_mixer_selem_get_capture_volume(elem, 0, &Rvol); snd_mixer_selem_get_capture_volume(elem, 1, &Lvol); if(need_reset) *need_reset = !!(max - Rvol); return (Rvol + Lvol) ? FALSE: TRUE; } }
INT32 PORT_GetIntValue(void* controlIDV) { PortControl* portControl = (PortControl*) controlIDV; int value = 0; snd_mixer_selem_channel_id_t channel; if (portControl != NULL) { switch (portControl->channel) { case CHANNELS_MONO: channel = SND_MIXER_SCHN_MONO; break; case CHANNELS_STEREO: channel = SND_MIXER_SCHN_FRONT_LEFT; break; default: channel = portControl->channel; } if (portControl->controlType == CONTROL_TYPE_MUTE || portControl->controlType == CONTROL_TYPE_SELECT) { if (isPlaybackFunction(portControl->portType)) { snd_mixer_selem_get_playback_switch(portControl->elem, channel, &value); } else { snd_mixer_selem_get_capture_switch(portControl->elem, channel, &value); } if (portControl->controlType == CONTROL_TYPE_MUTE) { value = ! value; } } else { ERROR1("PORT_GetIntValue(): inappropriate control type: %s\n", portControl->controlType); } } return (INT32) value; }
static int lamixer_switchbox_change(snd_mixer_elem_t *elem, unsigned int mask) { SwitchBox *swbox; int volsw; if (mask == SND_CTL_EVENT_MASK_REMOVE) return 0; if (mask & SND_CTL_EVENT_MASK_VALUE) { swbox = snd_mixer_elem_get_callback_private(elem); if (swbox->type == 1) { snd_mixer_selem_get_playback_switch (swbox->volelem, SND_MIXER_SCHN_FRONT_LEFT, &volsw); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(swbox->volswitch)) != volsw) { g_signal_handler_block(G_OBJECT(swbox->volswitch), swbox->hswsignalid); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(swbox->volswitch), volsw); g_signal_handler_unblock(G_OBJECT(swbox->volswitch), swbox->hswsignalid); } } } return 0; }
char *get_vol(char *buf) { long max = 0, min = 0, vol = 0; int mute = 0; snd_mixer_t *handle; snd_mixer_elem_t *pcm_mixer, *mas_mixer; snd_mixer_selem_id_t *vol_info, *mute_info; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, "default"); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_malloc(&vol_info); snd_mixer_selem_id_malloc(&mute_info); snd_mixer_selem_id_set_name(vol_info, VOL_CH); snd_mixer_selem_id_set_name(mute_info, VOL_CH); pcm_mixer = snd_mixer_find_selem(handle, vol_info); mas_mixer = snd_mixer_find_selem(handle, mute_info); snd_mixer_selem_get_playback_volume_range((snd_mixer_elem_t *)pcm_mixer, &min, &max); snd_mixer_selem_get_playback_volume((snd_mixer_elem_t *)pcm_mixer, SND_MIXER_SCHN_MONO, &vol); snd_mixer_selem_get_playback_switch(mas_mixer, SND_MIXER_SCHN_MONO, &mute); sprintf(buf, !(mute) ? VOL_MUTE_S : VOL_S, (int)vol * 100 / (int)max); if(vol_info) snd_mixer_selem_id_free(vol_info); if(mute_info) snd_mixer_selem_id_free(mute_info); if(handle) snd_mixer_close(handle); return buf; }
char* getvolume() { int sound_on; double normalized_volume; int err; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, soundcard); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); snd_mixer_selem_id_set_name(sid, soundelement); snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); err = snd_mixer_selem_get_playback_switch(elem, channel, &sound_on); if (err < 0 || !sound_on) { snd_mixer_close(handle); /* return smprintf("\x9D "); */ return smprintf("Muted \x19 "); } normalized_volume = getnormvolume(elem); snd_mixer_close(handle); /* return smprintf("%.0f\x90 ", normalized_volume * 100); */ return smprintf("Vol %.0f%% \x19 ", normalized_volume * 100); }
void SetAlsaSwitchMute(const char* card, const char* selem_name) { // long min, max; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, card); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); snd_mixer_selem_id_set_name(sid, selem_name); snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); int* muted; snd_mixer_selem_channel_id_t channel; snd_mixer_selem_get_playback_switch(elem,channel,muted); printf("Muted: %d\n",*muted); if (snd_mixer_selem_has_playback_switch(elem)) { snd_mixer_selem_set_playback_switch_all(elem, !*muted); } snd_mixer_close(handle); }
char *getvolume() { char *buf; int active; long volume, min, max; snd_mixer_t *handle; snd_mixer_selem_id_t *sid; snd_mixer_elem_t* elem; const char *card = "default"; const char *selem_name = "Master"; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, card); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); snd_mixer_selem_id_set_name(sid, selem_name); elem = snd_mixer_find_selem(handle, sid); snd_mixer_selem_get_playback_volume_range(elem, &min, &max); snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &volume); snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, &active); buf = xmalloc(10); if (active) snprintf(buf, 10, "%0.f%%", (double) volume / (double) max * 100); else snprintf(buf, 10, "off"); snd_mixer_close(handle); return buf; }
void AmeSystemSound::mute() { int sw; if (snd_mixer_selem_has_playback_switch(mixer_element)) { snd_mixer_selem_get_playback_switch(mixer_element, SND_MIXER_SCHN_FRONT_LEFT, &sw); snd_mixer_selem_set_playback_switch_all(mixer_element, !sw); } }
/** * Check whether sound is currently muted. * * @return 0 if mixer is muted, 1 otherwise */ int ismuted(void) { int muted = 1; if (snd_mixer_selem_has_playback_switch(elem)) snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, &muted); return muted; }
bool AlsaMixer::get_mute() { if (snd_mixer_selem_has_playback_switch(this->active_elem)) { int muted; snd_mixer_handle_events(this->handle); // TODO: write actual playback switch logic if (snd_mixer_selem_get_playback_switch(this->active_elem, UNKN, &muted) < 0) snd_mixer_selem_get_playback_switch(this->active_elem, LEFT, &muted); return !(bool)muted; } else { return (this->get_volume() == 0 ? true : false); } }
static void _get_switch(snd_mixer_elem_t *elem, int playback, int n, int *val) { if (playback) { snd_mixer_selem_get_playback_switch(elem, n, val); } else { snd_mixer_selem_get_capture_switch(elem, n, val); *val = !*val; } }
void lamixer_volbox_show(VolBox *volumebox, snd_mixer_elem_t *elem, GtkWidget *mixerbox) { long rangevalue_left,rangevalue_right; int mute, *bCols; if (volumebox->type == 1) { snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue_left); bCols = &pCols; } else if (volumebox->type == 2) { snd_mixer_selem_get_capture_volume (elem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue_left); bCols = &cCols; } volumebox->curval = rangevalue_left; gtk_table_attach(GTK_TABLE(mixerbox), volumebox->vollabel, *bCols-1, *bCols, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0); gtk_range_set_value(GTK_RANGE(volumebox->volbar), rangevalue_left); gtk_box_pack_start(GTK_BOX(volumebox->volbarbox), volumebox->volbar, TRUE, TRUE, 0); volumebox->hsignalid = g_signal_connect(G_OBJECT(volumebox->volbar), "value-changed", G_CALLBACK(lamixer_volbox_changed), volumebox); if (volumebox->rvolbar != NULL) { if (volumebox->type == 1) { snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_FRONT_RIGHT, &rangevalue_right); } else if (volumebox->type == 2) { snd_mixer_selem_get_capture_volume (elem, SND_MIXER_SCHN_FRONT_RIGHT, &rangevalue_right); } volumebox->rcurval = rangevalue_right; gtk_box_pack_start(GTK_BOX(volumebox->volbarbox), volumebox->rvolbar, TRUE, TRUE, 0); gtk_range_set_value(GTK_RANGE(volumebox->rvolbar), rangevalue_right); volumebox->hsignalidr = g_signal_connect(G_OBJECT(volumebox->rvolbar), "value-changed", G_CALLBACK(lamixer_volboxr_changed), volumebox); } gtk_table_attach(GTK_TABLE(mixerbox), volumebox->volbarbox, *bCols-1, *bCols, 1, 2, GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0); if (volumebox->lockswitch != NULL) { gtk_table_attach(GTK_TABLE(mixerbox), volumebox->lockswitch, *bCols-1, *bCols, 2, 3, GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(volumebox->lockswitch), TRUE); } if (volumebox->muteswitch != NULL) { snd_mixer_selem_get_playback_switch (elem, SND_MIXER_SCHN_FRONT_LEFT, &mute); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(volumebox->muteswitch), !mute); volumebox->hmutesignalid = g_signal_connect(G_OBJECT(volumebox->muteswitch), "toggled", G_CALLBACK(lamixer_muteswitch_changed), elem); gtk_table_attach(GTK_TABLE(mixerbox), volumebox->muteswitch, *bCols-1, *bCols, 3, 4, GTK_SHRINK, GTK_SHRINK, 0, 0); } gtk_table_resize(GTK_TABLE(mixerbox), mRows, ++(*bCols)); gtk_table_attach(GTK_TABLE(mixerbox), gtk_vseparator_new (), *bCols-1, *bCols, 0, 5, GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 4, 0); gtk_table_resize(GTK_TABLE(mixerbox), mRows, ++(*bCols)); }
bool AmeSystemSound::isMuted() { int sw; if (snd_mixer_selem_has_playback_switch(mixer_element)) { snd_mixer_selem_get_playback_switch(mixer_element, SND_MIXER_SCHN_FRONT_LEFT, &sw); return !sw; } else return false; }
MixerToggle::MixerToggle(QWidget *parent, snd_mixer_elem_t *snd_mix, QString name) : QCheckBox(name, parent), snd_mix(snd_mix) { int current; snd_mixer_selem_get_playback_switch (snd_mix, SND_MIXER_SCHN_FRONT_LEFT, ¤t); setChecked(current); connect(this, SIGNAL(stateChanged(int)), this, SLOT(setSndState(int))); }
int alsactl_get_switch(void* handle, char* name, int* val) { snd_mixer_elem_t* elem = alsactl_find_selem(handle, name); if (! elem) return 1; snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, val); return 0; }
/** * Checks if sound is muted. * * @return true if sound is muted */ bool MMSAudioCtrl::isMute() { if(isSwitchable) { int valL = 0; int valR = 0; snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_LEFT, &valL); snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_FRONT_RIGHT, &valR); if(valL > 0 || valR > 0) { return false; } return true; } if (this->muteFlag) { if (getVolume(true) > 0) { /* switch to off */ this->muteFlag = false; } } return this->muteFlag; }
static gboolean brightside_volume_alsa_get_mute (BrightsideVolume *vol) { BrightsideVolumeAlsa *self = (BrightsideVolumeAlsa *) vol; int ival; snd_mixer_selem_get_playback_switch(self->_priv->elem, SND_MIXER_SCHN_FRONT_LEFT, &ival); return !ival; }
char * get_vol(snd_mixer_t *handle, snd_mixer_elem_t *elem) { int mute = 0; long vol, max, min; snd_mixer_handle_events(handle); snd_mixer_selem_get_playback_volume_range(elem, &min, &max); snd_mixer_selem_get_playback_volume(elem, 0, &vol); snd_mixer_selem_get_playback_switch(elem, 0, &mute); return smprintf(mute == 0 ? VOL_MUTE : VOL, (vol * 100) / max); }
void lamixer_switchbox_show(SwitchBox *swbox, GtkWidget *swvbox) { int swstat; snd_mixer_selem_get_playback_switch (swbox->volelem, SND_MIXER_SCHN_FRONT_LEFT, &swstat); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(swbox->volswitch), swstat); swbox->hswsignalid = g_signal_connect(G_OBJECT(swbox->volswitch), "toggled", G_CALLBACK(lamixer_volswitch_changed), swbox->volelem); gtk_box_pack_start(GTK_BOX(swvbox), swbox->volswitch, TRUE, TRUE, 0); snd_mixer_elem_set_callback(swbox->volelem, lamixer_switchbox_change); snd_mixer_elem_set_callback_private(swbox->volelem, swbox); }
gboolean asound_get_mute() { assert(m_elem != NULL); gboolean mute = FALSE; if(snd_mixer_selem_has_playback_switch(m_elem)) { int pswitch; snd_mixer_selem_get_playback_switch(m_elem, 0, &pswitch); mute = pswitch ? FALSE : TRUE; } return mute; }
int get_vol_mute(long* vol, int* mute) { snd_mixer_t* handle; int open_code = snd_mixer_open(&handle, 0); if (open_code != 0) return open_code; int attach_code = snd_mixer_attach(handle, "default"); if (attach_code != 0) { snd_mixer_close(handle); return attach_code; } int register_code = snd_mixer_selem_register(handle, NULL, NULL); if (register_code != 0) { cleanup_handle(handle); return register_code; } int load_code = snd_mixer_load(handle); if (load_code != 0) { cleanup_handle(handle); return load_code; } snd_mixer_selem_id_t *sid; snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); snd_mixer_selem_id_set_name(sid, "Master"); snd_mixer_elem_t* elem = snd_mixer_find_selem(handle, sid); if (elem == 0) { cleanup_handle(handle); return 1; } int vol_code = snd_mixer_selem_get_playback_dB(elem, SND_MIXER_SCHN_UNKNOWN, vol); if (vol_code != 0) { cleanup_handle(handle); return vol_code; } int switch_code = snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_UNKNOWN, mute); if (switch_code != 0) { cleanup_handle(handle); return switch_code; } /* snd_mixer_selem_id_free(sid); */ snd_mixer_detach(handle, "default"); snd_mixer_close(handle); return 0; }
static int elem_get_status(snd_mixer_elem_t *elem) { int i, psw = -1; for (i = 0; i <= SND_MIXER_SCHN_LAST; i++) { if (snd_mixer_selem_has_playback_channel(elem, i) && snd_mixer_selem_has_playback_switch(elem)) snd_mixer_selem_get_playback_switch(elem, i, &psw); else if (snd_mixer_selem_has_capture_channel(elem, i) && snd_mixer_selem_has_capture_switch(elem)) snd_mixer_selem_get_capture_switch(elem, i, &psw); } return psw; }
void togglemute(snd_mixer_elem_t *elem) { int status; snd_mixer_selem_get_playback_switch(elem, 0, &status); switch (status) { case 0: status = 1; break; case 1: status = 0; break; default: return; } snd_mixer_selem_set_playback_switch_all(elem, status); }
static int lamixer_volbox_change(snd_mixer_elem_t *elem, unsigned int mask) { long rangevalue=0; int mutesw; MixerElem *mixer_elem; if (mask == SND_CTL_EVENT_MASK_REMOVE) return 0; if (mask & SND_CTL_EVENT_MASK_VALUE) { mixer_elem = snd_mixer_elem_get_callback_private(elem); if(mixer_elem->playback != NULL) { snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue); lamixer_volbox_check(mixer_elem->playback->volbar, mixer_elem->playback->hsignalid, rangevalue, &mixer_elem->playback->curval); if(mixer_elem->playback->rvolbar != NULL) { rangevalue=0; snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, &rangevalue); lamixer_volbox_check(mixer_elem->playback->rvolbar, mixer_elem->playback->hsignalidr, rangevalue, &mixer_elem->playback->rcurval); } if(mixer_elem->playback->muteswitch != NULL) { snd_mixer_selem_get_playback_switch (elem, SND_MIXER_SCHN_FRONT_LEFT, &mutesw); lamixer_switch_checkvalue(mixer_elem->playback->muteswitch, mutesw, mixer_elem->playback->hmutesignalid); } } if(mixer_elem->capture != NULL) { rangevalue=0; snd_mixer_selem_get_capture_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, &rangevalue); lamixer_volbox_check(mixer_elem->capture->volbar, mixer_elem->capture->hsignalid, rangevalue, &mixer_elem->capture->curval); if(mixer_elem->capture->rvolbar != NULL) { rangevalue=0; snd_mixer_selem_get_capture_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, &rangevalue); lamixer_volbox_check(mixer_elem->capture->rvolbar, mixer_elem->capture->hsignalidr, rangevalue, &mixer_elem->capture->rcurval); } if(mixer_elem->capture->muteswitch != NULL) { snd_mixer_selem_get_capture_switch (elem, SND_MIXER_SCHN_FRONT_LEFT, &mutesw); lamixer_switch_checkvalue(mixer_elem->capture->muteswitch, mutesw, mixer_elem->capture->hmutesignalid); } } } return 0; }
bool AlsaMixer::GetChannelSwitch( const char* channel, bool* on ) { bool success = false; snd_mixer_elem_t *elem; snd_mixer_selem_id_t *sid; snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index( sid, 0); snd_mixer_selem_id_set_name( sid, channel); elem = snd_mixer_find_selem(_handle, sid); if (!elem) { LOG( Logger::LOG_ERROR, "Unable to find simple control '%s',%i\n", snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid)); goto end; } if( snd_mixer_selem_has_playback_switch(elem) ) { for (int chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++) { int value; if (snd_mixer_selem_get_playback_switch(elem, (snd_mixer_selem_channel_id_t)chn, &value) >= 0) { *on = value != 0; success = true; break; } } }else if( snd_mixer_selem_has_capture_switch(elem) ) { for (int chn = 0; chn <= SND_MIXER_SCHN_LAST; chn++) { int value; if (snd_mixer_selem_get_capture_switch(elem, (snd_mixer_selem_channel_id_t)chn, &value ) >= 0) { *on = value != 0; success = true; break; } } } if( !success ) { LOG( Logger::LOG_ERROR, "Error getting control '%s',%i\n", snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid)); } end: return success; }
/** * getvolume * determine the current volume */ int getvolume() { static long min = 0; static long max = 0; long volume; int mute; /* get min/max volume if necessary */ if (!min && !max) snd_mixer_selem_get_playback_volume_range(alsamixer, &min, &max); /* get volume and mute */ snd_mixer_selem_get_playback_volume(alsamixer, SND_MIXER_SCHN_MONO, &volume); snd_mixer_selem_get_playback_switch(alsamixer, SND_MIXER_SCHN_MONO, &mute); return !mute?0:volume>min?volume<max?(volume*100)/max:100:0; }
gboolean gam_toggle_get_state (GamToggle *gam_toggle) { GamTogglePrivate *priv; gint value = 0; priv = GAM_TOGGLE_GET_PRIVATE (gam_toggle); if (snd_mixer_selem_has_playback_switch (priv->elem)) { snd_mixer_selem_get_playback_switch (priv->elem, 0, &value); } else if (snd_mixer_selem_has_capture_switch (priv->elem)) { snd_mixer_selem_get_capture_switch (priv->elem, 0, &value); } else { g_warning ("%s (). No idea what to do for mixer element \"%s\"!", __FUNCTION__, snd_mixer_selem_get_name (priv->elem)); } return value; }
static void set_headphones_plugged(int* plugged) { snd_mixer_t *handle; snd_mixer_open(&handle, 0); snd_mixer_attach(handle, Y50_CTL_NAME); snd_mixer_selem_register(handle, NULL, NULL); snd_mixer_load(handle); snd_mixer_selem_id_t *headphone_sid; const char *headphone_selem_name = "Headphone"; snd_mixer_selem_id_alloca(&headphone_sid); snd_mixer_selem_id_set_index(headphone_sid, 0); snd_mixer_selem_id_set_name(headphone_sid, headphone_selem_name); snd_mixer_elem_t *elem = snd_mixer_find_selem(handle, headphone_sid); snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_MONO, plugged); snd_mixer_close(handle); }
/* * Class: org_tritonus_lowlevel_alsa_AlsaMixerElement * Method: getPlaybackSwitch * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_tritonus_lowlevel_alsa_AlsaMixerElement_getPlaybackSwitch (JNIEnv* env, jobject obj, jint nChannelType) { snd_mixer_elem_t* handle; int nReturn; int nValue; if (debug_flag) { (void) fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaMixerElement_getPlaybackSwitch(): begin\n"); } handle = getHandle(env, obj); nReturn = snd_mixer_selem_get_playback_switch(handle, (snd_mixer_selem_channel_id_t) nChannelType, &nValue); if (nReturn < 0) { throwRuntimeException(env, snd_strerror(nReturn)); } if (debug_flag) { (void) fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaMixerElement_getPlaybackSwitch(): end\n"); } return (jboolean) nValue; }