void CBitCrunchPane::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { switch(pControl->GetID()) { } GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); }
void CKSExportForWebGUIPane::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { switch(pControl->GetID()) { case giCtrl_ExportForWeb: { /* std::string sViolations = ""; if (!mbMayExport) { sViolations += " - This project must not be re-exported.\n"; } if ((!mbMayChangeLicense) && (miLicenseNb != mpPlugIn->miPreviousLicenseNb)) { sViolations += " - You are not allowed to alter the license.\n"; } if ((!mbMayBeCommercial) && (miLicenseNb < 3)) { sViolations += " - This project has been previouly released\n" " under a non-commercial license, so you can't\n" " re-export it as a commercial project.\n"; } if (sViolations.length() > 0) { ShowSorryDialog(sViolations); } else*/ { GetPlugIn()->SetGlobalParm(giParamID_Show_Export_For_Web_Window, 0, giSectionGUI); tchar pszAuthor[1024]; tchar pszUrl[1024]; tchar pszStatus[1024]; mpTextAuthor->GetText(pszAuthor); mpTextUrl->GetText(pszUrl); mpTextStatus->GetText(pszStatus); dynamic_cast<CKSPlugIn*>(GetPlugIn())->Export_For_Web(meQuality, miLicenseNb, pszAuthor, pszUrl, pszStatus); } break; } case giCtrl_Cancel_ExportForWeb: { GetPlugIn()->SetGlobalParm(giParamID_Show_Export_For_Web_Window, 0, giSectionGUI); break; } case giCtrl_CC_License_Radio_Button: { miLicenseNb = iValueNew; mpLicense->SetFrame(iValueNew); break; } case giCtrl_Export_Compression_Popup: { meQuality = (ac::EQuality)iValueNew; } break; } GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); } // EventValueChange
void CMix_Buss::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { if( pControl->GetID() == giCtr_Mix_Buss_Show_Insert_Button + miCtrl_Offset) { // Send expand channel message SBussData sData; sData.iParam_ID = giParam_Buss_Info_Show_Inserts; sData.iVal = iValueNew; sData.iBuss = miID; SMsg Msg = Msg_Buss_Data; Msg.pDataIn = (void*)&sData; SendMsgFromTop(&Msg); } GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); }
void CKSUsername_And_Password_Pane::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); switch (pControl->GetID()) { // cancel case giCtrl_Username_And_Password_Cancel:{ // close sign in window gpApplication->SetGlobalParm(giParamID_Show_Sign_In_Window, 0, giSectionGUI); // restore remember me mpRemember_Me_Button->SetValue(gpApplication->Get_Remember_Me()); // restore username text tchar pszTxt[1024]; sprintf(pszTxt, gpApplication->Get_User_Name().c_str()); mpUser_Name_Txt->SetText(pszTxt); // restore password text sprintf(pszTxt, gpApplication->Get_Password().c_str()); mpPassword_Txt->SetText(pszTxt); break; } // ok case giCtrl_Username_And_Password_OK:{ // close sign in window gpApplication->SetGlobalParm(giParamID_Show_Sign_In_Window, 0, giSectionGUI); // set remember me gpApplication->Set_Remember_Me( mpRemember_Me_Button->GetValue()); // user name tchar pszTxt[1024]; mpUser_Name_Txt->GetText(pszTxt); gpApplication->Set_User_Name(pszTxt); // password mpPassword_Txt->GetText(pszTxt); gpApplication->Set_Password(pszTxt); // Save to preferences gpDSPEngine->SavePrefs(); // save sign in info, commit project if needed gpApplication->On_Username_And_Password_OK(); break; } } }
void CTrack_Files::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); }
void CKSSetupGUIPane::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); switch (pControl->GetID()) { // New audio device case giCtrl_Sound_Card_Popup: { // Attempt lock if (++miBlockSetAudioDevice_volatile != 1) { // We're not alone - release lock miBlockSetAudioDevice_volatile--; } else { CKSDSP* pDSP = dynamic_cast<CKSDSP*>(GetPlugIn()->GetDSPEngine()); tbool bSuccess = pDSP->OpenAudioDevice_FromMenu_Output(iValueNew, -1, -1); // Fill popup with valid frequencies and buffer sizes InitAudioDevicePopupValues(); if (!bSuccess) { ThatDidntWork(); } // Release lock miBlockSetAudioDevice_volatile--; } } break; case giCtrl_Sound_Card_In_Popup: { // Attempt lock if (++miBlockSetAudioDevice_volatile != 1) { // We're not alone - release lock miBlockSetAudioDevice_volatile--; } else { CKSDSP* pDSP = dynamic_cast<CKSDSP*>(GetPlugIn()->GetDSPEngine()); tbool bSuccess = pDSP->OpenAudioDevice_FromMenu_Input(iValueNew, /*-1,*/ -1); // Fill popup with valid frequencies and buffer sizes InitAudioDevicePopupValuesInput(); if (!bSuccess) { ThatDidntWork(); } // Release lock miBlockSetAudioDevice_volatile--; } } break; // New sample rate case giCtrl_Sample_Rate_Popup: { // Attempt lock if (++miBlockSetAudioDevice_volatile != 1) { // We're not alone - release lock miBlockSetAudioDevice_volatile--; } else { CKSDSP* pDSP = dynamic_cast<CKSDSP*>(GetPlugIn()->GetDSPEngine()); tint32 iMgr = pDSP->mPrefs_1.iAudioManagerIx; tint32 iDev = pDSP->mPrefs_1.iAudioDeviceIx; tchar* pszDev = pDSP->mPrefs_1.pszAudioDevName; tint32 iFrq = iValueNew * 100; //pDSP->mPrefs_1.iAudioSampleRate; tint32 iBuf = pDSP->mPrefs_1.iAudioBufferSize; tbool bSuccess = pDSP->OpenAudioDevice_Output(iMgr, iDev, pszDev, iFrq, iBuf, true); if (!bSuccess) { ThatDidntWork(); } // Release lock miBlockSetAudioDevice_volatile--; } } break; // New buffer size case giCtrl_Buffer_Size_Popup: { // Attempt lock if (++miBlockSetAudioDevice_volatile != 1) { // We're not alone - release lock miBlockSetAudioDevice_volatile--; } else { CKSDSP* pDSP = dynamic_cast<CKSDSP*>(GetPlugIn()->GetDSPEngine()); tint32 iMgr = pDSP->mPrefs_1.iAudioManagerIx; tint32 iDev = pDSP->mPrefs_1.iAudioDeviceIx; tchar* pszDev = pDSP->mPrefs_1.pszAudioDevName; tint32 iFrq = pDSP->mPrefs_1.iAudioSampleRate; tint32 iBuf = iValueNew * 32; //pDSP->mPrefs_1.iAudioBufferSize; tbool bSuccess = pDSP->OpenAudioDevice_Output(iMgr, iDev, pszDev, iFrq, iBuf, true); if (!bSuccess) { ThatDidntWork(); } // Release lock miBlockSetAudioDevice_volatile--; } } break; case giCtrl_Close_Audio_Setup: { //tbool bTest = GetPlugIn()->GetGlobalParm(giParamID_Audio_Setup_Window, giSectionGUI) ; GetPlugIn()->SetGlobalParm(giParamID_Audio_Setup_Window,false, giSectionGUI); } } }
void CRegion_GUI::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); }
void CPlugin_Toolbar::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); }
void CKSImportGUIPane::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { switch(pControl->GetID()) { case giCtrl_Import: { if (mpImport_Files->GetAddedFiles() == 0) { mpGUI->GetWindow()->ShowMessageBox("You must add some files\nbefore clicking import", "Sorry"); } else { mpImport_Files->ImportFiles(); GetPlugIn()->SetGlobalParm(giParamID_Show_Import_Window, 0, giSectionGUI); PreviewStop(); } break; } case giCtrl_Cancel_Import: { mpImport_Files->ClearFiles(); GetPlugIn()->SetGlobalParm(giParamID_Show_Import_Window, 0, giSectionGUI); PreviewStop(); break; } case giCtrl_Browser_Popup: { if (iValueNew != mpFile_Browser_Popup.iItemCount - 1) { PreviewStop(); std::string s(":"); tint32 iIndex; for (iIndex = 1; iIndex <= iValueNew; iIndex++) { s += std::string((const char*)(mpFile_Browser_Popup.pItems[iIndex].pszText)); s += ":"; } BrowseToDir(s); } } break; case giCtrl_Play_Import: if (iValueNew == 1) { if (!PreviewStart()) { GetControl(giCtrl_Play_Import)->SetValue(0); } } else { PreviewStop(); } break; case giCtrl_Stop_Import: PreviewStop(); break; case giCtrl_Add_Import: { std::string sPathName = mpImport_File_Browser->GetSelectedFile(); AddFile(sPathName); } break; case giCtrl_Remove_Import: mpImport_Files->RemoveFile(); break; } GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); } // EventValueChange
void CKS_Import_File_Browser::EventValueChange(ge::IControl* pControl, tint32 iValueNew) { GetParmMan()->ControlUpdate(miPaneID, pControl->GetID(), iValueNew); switch(pControl->GetID()) { case giCtrl_File_List: { tbool bIsDoubleClick = (iValueNew == -2); if (iValueNew >= -1) { miLatestGenuineIndex = iValueNew; } tint32 iIndex = miLatestGenuineIndex; //pControl->GetValue(); std::list<SItemInfo>::const_iterator it = mItems.begin(); while (iIndex > 0) { iIndex--; it++; } SItemInfo Info = *it; if (Info.bDir == true) { mpImportGUI->PreviewStop(); miLatestSelectedFile = -1; std::string sPath(msPath); sPath += Info.sName; sPath += ":"; if (bIsDoubleClick) { mpImportGUI->BrowseToDir(sPath); } } else { tbool bSameFile = (miLatestGenuineIndex == miLatestSelectedFile); if (bSameFile) { // Same file if (bIsDoubleClick) { // Add file to import list std::string sPathName(msPath); sPathName += Info.sName; mpImportGUI->AddFile(sPathName); } } else { // New file - read its info // First we need to stop previewing (may crash on read info if we don't) mpImportGUI->PreviewStop(); // Get info miLatestSelectedFile = miLatestGenuineIndex; std::string sPathName(msPath); sPathName += Info.sName; CAutoDelete<IFile> pFile(IFile::Create()); if (pFile->Open(sPathName.c_str(), IFile::FileRead)) { ac::IDecoder* pdec = ac::IDecoder::Create(pFile); if (pdec) { // Attempt to test file - if it fails ignore it pdec->TestFile(pFile); // Now we have tried to decipher file - we pretend it succeeded CAutoDelete<ac::IDecoder> pDecoder(pdec); ac::EAudioCodec Codec = pDecoder->GetAudioCodec(); if (Codec == ac::geAudioCodecWave) { mpImportGUI->SetType(0); ac::EQuality eQ = ac::geQualityUnknown; tint32 iBitDepth = pdec->miLastInputBitWidth; if (iBitDepth == 16) eQ = ac::geQualityLossless16; else if (iBitDepth == 24) eQ = ac::geQualityLossless24; tint32 iSampleRate = pdec->miOutputSampleFreq; tint32 iChannels = pdec->miOutputChannels; mpImportGUI->SetInfo(eQ, iSampleRate, iChannels); } else if (Codec == geAudioCodecVorbis) { mpImportGUI->SetType(1); tint32 iSampleRate = pdec->miOutputSampleFreq; tint32 iChannels = pdec->miOutputChannels; mpImportGUI->SetInfo(pdec->meLowestInputQuality, iSampleRate, iChannels); } else { mpImportGUI->SetType(2); tint32 iSampleRate = pdec->miOutputSampleFreq; tint32 iChannels = pdec->miOutputChannels; mpImportGUI->SetInfo(pdec->meLowestInputQuality, iSampleRate, iChannels); } } } } } } break; } } // EventValueChange