static void GUINewMode(void) { int Max, Sel; char* buffer; char* arg1 = getRecord(); char* arg2 = getAuthor(); char* arg3 = getCopyright(); char* arg4 = getDriver(); char* arg5 = getVersion(); buffer = AllocVec( strlen( arg1 ) + strlen( arg2 ) + strlen( arg3 ) + strlen( arg4 ) + strlen( arg5 ) + 128, MEMF_ANY); if( buffer != NULL ) { sprintf( buffer,"0x%08lx\n%s\n%s\n%s\nDevs:AHI/%s.audio\n%s", getAudioMode(), arg1, arg2, arg3, arg4, arg5 ); set(MUIInfos, MUIA_Text_Contents, (ULONG) buffer); FreeVec(buffer); } Max = max(state.Frequencies -1, 0); Sel = min(Max, state.FreqSelected); set(MUIFreq, MUIA_Disabled, Max==0); set(MUIFreq, MUIA_Numeric_Max, Max); set(MUIFreq, MUIA_Numeric_Value, Sel); set(MUILFreq, MUIA_Text_Contents, (ULONG) getFreq()); Max = max(state.Channels, 0); Sel = min(Max, state.ChannelsSelected); set(MUIChannels, MUIA_Disabled, (Max == 1) || state.ChannelsDisabled); set(MUIChannels, MUIA_Numeric_Max, Max); set(MUIChannels, MUIA_Numeric_Value, Sel); set(MUILChannels, MUIA_Text_Contents, (ULONG) getChannels()); Max = max(state.OutVols -1, 0); Sel = min(Max, state.OutVolSelected); set(MUIOutvol, MUIA_Disabled, Max==0); set(MUIOutvol, MUIA_Numeric_Max, Max); set(MUIOutvol, MUIA_Numeric_Value, Sel); set(MUILOutvol, MUIA_Text_Contents, (ULONG) getOutVol()); Max = max(state.MonVols -1, 0); Sel = min(Max, state.MonVolSelected); set(MUIMonvol, MUIA_Disabled, Max==0); set(MUIMonvol, MUIA_Numeric_Max, Max); set(MUIMonvol, MUIA_Numeric_Value, Sel); set(MUILMonvol, MUIA_Text_Contents, (ULONG) getMonVol()); Max = max(state.Gains -1, 0); Sel = min(Max, state.GainSelected); set(MUIGain, MUIA_Disabled, Max==0); set(MUIGain, MUIA_Numeric_Max, Max); set(MUIGain, MUIA_Numeric_Value, Sel); set(MUILGain, MUIA_Text_Contents, (ULONG) getGain()); Max = max(state.Inputs -1, 0); Sel = min(Max, state.InputSelected); set(MUIInput, MUIA_Disabled, Max==0); set(MUIInput, MUIA_Numeric_Max, Max); set(MUIInput, MUIA_Numeric_Value, Sel); set(MUILInput, MUIA_Text_Contents, (ULONG) getInput()); Max = max(state.Outputs -1, 0); Sel = min(Max, state.OutputSelected); set(MUIOutput, MUIA_Disabled, Max==0); set(MUIOutput, MUIA_Numeric_Max, Max); set(MUIOutput, MUIA_Numeric_Value, Sel); set(MUILOutput, MUIA_Text_Contents, (ULONG) getOutput()); }
static void GUINewMode(void) { int Max, Sel; sprintf(modetext,"0x%08lx", getAudioMode()); infoargs[0] = modetext; infoargs[1] = getRecord(); infoargs[2] = getAuthor(); infoargs[3] = getCopyright(); sprintf(drivertext, "Devs:AHI/%s.audio", getDriver()); infoargs[4] = drivertext; infoargs[5] = getVersion(); MySetGadgetAttrs(Window_Objs[SHOWID_MODE], LISTBROWSER_Labels, ~0, TAG_DONE); if(infolist) FreeBrowserNodes2(infolist); infolist = BrowserNodes2(infotexts, infoargs); MySetGadgetAttrs(Window_Objs[SHOWID_MODE], LISTBROWSER_Labels, infolist, TAG_DONE); Max = max(state.Frequencies -1, 0); Sel = min(Max, state.FreqSelected); MySetGadgetAttrs(Window_Objs[ACTID_FREQ], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); Max = max(state.Channels, 1); Sel = min(Max, state.ChannelsSelected); MySetGadgetAttrs(Window_Objs[ACTID_CHANNELS], SLIDER_Min, 1, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 1) || state.ChannelsDisabled, TAG_DONE ); Max = max(state.OutVols -1, 0); Sel = min(Max, state.OutVolSelected); MySetGadgetAttrs(Window_Objs[ACTID_OUTVOL], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); Max = max(state.MonVols -1, 0); Sel = min(Max, state.MonVolSelected); MySetGadgetAttrs(Window_Objs[ACTID_MONVOL], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); Max = max(state.Gains -1, 0); Sel = min(Max, state.GainSelected); MySetGadgetAttrs(Window_Objs[ACTID_GAIN], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); Max = max(state.Inputs -1, 0); Sel = min(Max, state.InputSelected); MySetGadgetAttrs(Window_Objs[ACTID_INPUT], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); Max = max(state.Outputs -1, 0); Sel = min(Max, state.OutputSelected); MySetGadgetAttrs(Window_Objs[ACTID_OUTPUT], SLIDER_Min, 0, SLIDER_Max, Max, SLIDER_Level, Sel, GA_Disabled, (Max == 0), TAG_DONE ); // Update indicators.. MySetGadgetAttrs(Window_Objs[SHOWID_FREQ], GA_Text, getFreq(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_CHANNELS], GA_Text, getChannels(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_OUTVOL], GA_Text, getOutVol(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_MONVOL], GA_Text, getMonVol(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_GAIN], GA_Text, getGain(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_INPUT], GA_Text, getInput(), TAG_DONE ); MySetGadgetAttrs(Window_Objs[SHOWID_OUTPUT], GA_Text, getOutput(), TAG_DONE ); }
static void GUINewMode(void) { int Max, Sel, Dis; char* buffer; char* arg1 = getRecord(); char* arg2 = getAuthor(); char* arg3 = getCopyright(); char* arg4 = getDriver(); char* arg5 = getVersion(); char* arg6 = getAnnotation(); buffer = AllocVec( strlen( arg1 ) + strlen( arg2 ) + strlen( arg3 ) + strlen( arg4 ) + strlen( arg5 ) + strlen( arg6 ) + 128, MEMF_ANY); if( buffer != NULL ) { sprintf( buffer,"0x%08lx\n%s\n%s\n%s\nDevs:AHI/%s.audio\n%s\n%s", getAudioMode(), arg1, arg2, arg3, arg4, arg5, arg6 ); set(MUIInfos, MUIA_Text_Contents, (ULONG) buffer); FreeVec(buffer); } Max = max(state.Frequencies -1, 0); Sel = min(Max, state.FreqSelected); Dis = Max==0; set(MUIFreq, MUIA_Disabled, Dis); if( !Dis ) { set(MUIFreq, MUIA_Numeric_Max, Max); set(MUIFreq, MUIA_Numeric_Value, Sel); } set(MUILFreq, MUIA_Text_Contents, (ULONG) getFreq()); Max = max(state.Channels, 0); Sel = min(Max, state.ChannelsSelected); Dis = (Max == 0 || Max == 1) || state.ChannelsDisabled; set(MUIChannels, MUIA_Disabled, Dis); if( !Dis ) { set(MUIChannels, MUIA_Numeric_Max, Max); set(MUIChannels, MUIA_Numeric_Value, Sel); } set(MUILChannels, MUIA_Text_Contents, (ULONG) getChannels()); if( state.ChannelsDisabled || AHIBase->lib_Version < 5) { set(MUIScalemode, MUIA_Disabled, TRUE); set(MUIScalemode, MUIA_Cycle_Active, AHI_SCALE_FIXED_SAFE); } else { set(MUIScalemode, MUIA_Disabled, FALSE); set(MUIScalemode, MUIA_Cycle_Active, state.ScaleModeSelected); } Max = max(state.OutVols -1, 0); Sel = min(Max, state.OutVolSelected); Dis = Max==0; set(MUIOutvol, MUIA_Disabled, Dis); if( !Dis ) { set(MUIOutvol, MUIA_Numeric_Max, Max); set(MUIOutvol, MUIA_Numeric_Value, Sel); } set(MUILOutvol, MUIA_Text_Contents, (ULONG) getOutVol()); Max = max(state.MonVols -1, 0); Sel = min(Max, state.MonVolSelected); Dis = Max==0; set(MUIMonvol, MUIA_Disabled, Dis); if( !Dis ) { set(MUIMonvol, MUIA_Numeric_Max, Max); set(MUIMonvol, MUIA_Numeric_Value, Sel); } set(MUILMonvol, MUIA_Text_Contents, (ULONG) getMonVol()); Max = max(state.Gains -1, 0); Sel = min(Max, state.GainSelected); Dis = Max==0; set(MUIGain, MUIA_Disabled, Dis); if( !Dis ) { set(MUIGain, MUIA_Numeric_Max, Max); set(MUIGain, MUIA_Numeric_Value, Sel); } set(MUILGain, MUIA_Text_Contents, (ULONG) getGain()); Max = max(state.Inputs -1, 0); Sel = min(Max, state.InputSelected); Dis = Max==0; set(MUIInput, MUIA_Disabled, Dis); if( !Dis ) { set(MUIInput, MUIA_Numeric_Max, Max); set(MUIInput, MUIA_Numeric_Value, Sel); } set(MUILInput, MUIA_Text_Contents, (ULONG) getInput()); Max = max(state.Outputs -1, 0); Sel = min(Max, state.OutputSelected); Dis = Max==0; set(MUIOutput, MUIA_Disabled, Dis); if( !Dis ) { set(MUIOutput, MUIA_Numeric_Max, Max); set(MUIOutput, MUIA_Numeric_Value, Sel); } set(MUILOutput, MUIA_Text_Contents, (ULONG) getOutput()); set(MUIPlay, MUIA_Disabled, getAudioMode() == AHI_INVALID_ID); }
Profile Configuration::getProfile() const{ Profile profile(getName()); MediaElement::Container container; if(getContainer(container)){ profile.setContainer(container); } int row; if(getVideoMode(row)){ profile.setVideoMode(row); } MediaElement::Format videoFormat; if(getVideoFormat(videoFormat)){ profile.setVideoFormat(videoFormat); } MediaElement::Encoder videoEncoder; if(getVideoEncoder(videoEncoder)){ profile.setVideoEncoder(videoEncoder); } MediaElement::Bitrate videoBitrate; if(getVideoBitrate(videoBitrate)){ profile.setVideoBitrate(videoBitrate); } MediaElement::Resolution resolution; if(getVideoResolution(resolution)){ profile.setVideoResolution(resolution); } MediaElement::FFpreset ffpreset; if(getVideoFFpreset(ffpreset)){ profile.setVideoFFpreset(ffpreset); } MediaElement::Framerate framerate; if(getVideoFramerate(framerate)){ profile.setVideoFramerate(framerate); } // if(getAudioMode(row)){ profile.setAudioMode(row); } MediaElement::Format audioFormat; if(getAudioFormat(audioFormat)){ profile.setAudioFormat(audioFormat); } MediaElement::Encoder audioEncoder; if(getAudioEncoder(audioEncoder)){ profile.setAudioEncoder(audioEncoder); } MediaElement::AudioGrade audioGrade; if(getAudioGrade(audioGrade)){ profile.setAudioGrade(audioGrade); } MediaElement::Samplerate audioSamplerate; if(getAudioSamplerate(audioSamplerate)){ profile.setAudioSamplerate(audioSamplerate); } MediaElement::Channel audioChannel; if(getAudioChannel(audioChannel)){ profile.setAudioChannel(audioChannel); } // std::list<Profile::ManualSettings> manualSettings; getManualSettings(manualSettings); profile.setManualSettings(manualSettings); return profile; }