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 CBaseTopPane::ActionLoad()
{
	// Get the directory
	std::string sPresetDirectory = mpGUI->GetPresetFolder();
	
	// Get product name
	tchar pszProductName[128];
	GetPlugIn()->GetProductName(pszProductName);

	// Create the dialog
	CAutoDelete<ge::IOpenDialog> pDialog(ge::IOpenDialog::Create());

	// Open dialog
	tchar pszPathName[512];
	pDialog->DoDialog((tchar*)pszPathName,
		(tchar*)(sPresetDirectory.c_str()),
		(tchar*)"*.preset",
		(tchar*)(std::string(pszProductName) + " Presets (*.preset)").c_str());

	if (pszPathName[0] == 0) {
		// Error in dialog, or user pressed cancel
		return;
	}

	msPresetPathName = std::string((char*)pszPathName);

	CAutoDelete<IChunkFile> pFile(IChunkFile::Create());
	tint32 iVersionNumber;
	if (pFile->Open((const tchar*)(msPresetPathName.c_str()),
		IFile::FileRead,
		iVersionNumber)) {
		mpGUI->OnLoadPreset(pFile);
	}
}
void CVST2KSPIGUI::OnAbout()
{
	tbool bIsRegistered = GetPlugIn()->IsRegistered();

	tchar psz[256];
	sprintf(psz, "Essential Compressor by KeyToSound, www.keytosound.com\nVersion 0.9b1\n%s",
		bIsRegistered ? "Registered" : "Not registered");

	CBaseGUI::GetWindow()->ShowMessageBox(psz, "Info");
}
CKSMixerGUIPane::CKSMixerGUIPane(CBasePane* pPaneParent, CBaseGUI* pGUI)
    : CBasePane(pPaneParent, pGUI)
{
    CBaseDSPEngine* pD = GetPlugIn()->GetDSPEngine();
    mpDSP = dynamic_cast<CKSDSP*>(pD);

    // Init meters arrays
    //mpvoid_sMeters_All = (void*)new CKSDSP::SMeters_All();
    mbFirstMeterSet = true;
    mbIsVisible = false;
}
void CKSImportGUIPane::Init()
{
    mpPane = ge::IPane::Create();
    mpPane->SetSize(ge::SSize(424,424));
    CreateBitmap(ge::IControl::giNoID, IDB_Back_Import, ge::SPos(0, 0));

    mpPop = NULL;

    //-------------------------------------------------
    // Scroll pane viewing the content in a "Folder"
    mpImport_File_Browser = new CKS_Import_File_Browser(this, GetGUI());
    mpImport_File_Browser->SetInfo();
    mpImport_File_Browser->Init();
    mpPane->AddControl(mpImport_File_Browser->GetPane(), ge::SPos(8, 39));
    Create_File_Browser_ScrollBar();

    //-------------------------------------------------
    // Scroll pane viewing a list of files to add to te project
    mpImport_Files = new CKS_Import_Files(this, GetGUI());
    mpImport_Files->SetInfo();
    mpImport_Files->Init();
    mpPane->AddControl(mpImport_Files->GetPane(), ge::SPos(216, 39));
    Create_File_ScrollBar();


    CreateButton(giCtrl_Remove_Import, IDB_Button_Move, ge::SPos(195, 345), false);
    CreateButton(giCtrl_Add_Import, IDB_Button_Add, ge::SPos(195, 369), false);
    // Stop
    CreateButton(giCtrl_Stop_Import, IDB_Button_Stop, ge::SPos(195, 369+24), false);
    // Play
    Create2StateButton(giCtrl_Play_Import, IDB_Button_Play, ge::SPos(195+28, 369+24), true);


    // Cancel / Export
    CreateButton(giCtrl_Cancel_Import, IDB_Button_Cancel, ge::SPos(292, 400), false);
    CreateButton(giCtrl_Import, IDB_Button_Import, ge::SPos(292 + 64, 400), false);

    tchar psz[1024];
    CKSPlugIn* pPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn());
    //IFile::GetSystemDirectory(IFile::SystemDirDesktop, psz);
    pPlugIn->GetDefaultProjectFolder(psz);
    BrowseToDir(std::string(psz));

    dynamic_cast<CKSPlugIn*>(GetGUI()->GetPlugIn())->SetPreviewCallback(dynamic_cast<CPreviewCallback*>(this));

    ge::IText* pText = CreateDisplay(giControlType, ge::SPos(96, 333+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlBitDepth, ge::SPos(96, 347+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlSampleRate, ge::SPos(96, 361+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlChannels, ge::SPos(96, 375+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
} // Init
void CVST2KSPIGUI::GetSize(tuint32* piSizeX, tuint32* piSizeY)
{
	if (mpVSTEffect == NULL) {
		mpVSTEffect = dynamic_cast<CVST2KSPIPlugIn*>(GetPlugIn())->GetEffect();
	}

	ERect* pRect = new ERect();
	mpVSTEffect->dispatcher(mpVSTEffect, effEditGetRect, 0, 0, &pRect, 0.0);

	*piSizeX = pRect->right;
	*piSizeY = pRect->bottom;
}
void CBaseTopPane::MIDIReset()
{
	ge::IWindow::EMsgBoxReturn Button = mpGUI->GetWindow()->ShowMessageBox((tchar*)"Your custom MIDI learn assignment will be lost and the factory default reinstated\n\nDo you wish to continue?", (tchar*)"Question", ge::IWindow::MsgBoxYesNo);
	if (Button != ge::IWindow::MsgBoxRetYes) {
		return;
	}

	// Stop any ongoing MIDI Learn or Unlearn operation
	MIDILearnOrUnlearnAbort();

	// Reset all MIDI
	GetPlugIn()->MIDICCReset();
}
void CTrack_Player2::SetInfo(CTrack_Player* CTrack_Player)
{

	mpCTrack_Player = CTrack_Player;
//	mfTempo			=	60;
	SetSignature(giSignature4_4);
	miLast_Grid_Line_Allocated		=	0;
	
	mpKSPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn());
	
	gpDSPEngine->SetRegionCallback(dynamic_cast<IRegionCallback*>(this));
	
}
void CVST2KSPIGUI::MakeWindow(void* p)
{
	if (mpVSTEffect == NULL) {
		mpVSTEffect = dynamic_cast<CVST2KSPIPlugIn*>(GetPlugIn())->GetEffect();
	}

	try {
		PreCreate();
		
		// Create the window
		mpWindow = ge::IWindow::Create();
		// Tell the window what context it's in
		mpWindow->SetContext(mpContext);
		
#ifdef WIN32
		mhWndParent = (HWND)p;
		mpVSTEffect->dispatcher(mpVSTEffect, effEditOpen, 0, 0, p, 0.0);
#endif
#ifdef _Mac
		/*void**/ mhWndParent = p;
		mpVSTEffect->dispatcher(mpVSTEffect, effEditOpen, 0, 0, p, 0.0);
#endif
		tuint32 iSizeX;
		tuint32 iSizeY;
		GetSize(&iSizeX, &iSizeY);
		
		ge::SRect rct(0, 0, iSizeX, iSizeY);
//		mpWindow->MakeWindow(mhWndParent, &rct, false);
		
		Initialize();
		
		// Make the window visible
//		mpWindow->ShowWindow();
		
//		mpWindow->InstallKeyboardHook();
		
//		mpWindow->AcquireKeyboardInput();

		mbWindowMade = true;
	}
	catch(IException* pException) {
		const tchar* psz = pException->GetFullDescription();
		
//		DoMsgBox(psz);
		
		pException->Destroy();
	}
	catch(...) {
//		DoMsgBox("Unknown Exception");
	}
}
void CVST2KSPIGUI::Initialize()
{
	if (mpVSTEffect == NULL) {
		mpVSTEffect = dynamic_cast<CVST2KSPIPlugIn*>(GetPlugIn())->GetEffect();
	}
	
	// Kindof a hack needed to make it possible to override from both gui and pane
	CBasePane::mpResMan = CBaseGUI::GetResMan();

	// Create the main pane
	CBasePane::mpPane = ge::IPane::Create();

	ConnectControls();
}
bool CZoomClutterRadarScreen::OnCompileCommand(const char * sCommandLine) {
	if (strcmp(sCommandLine, ".zs") != 0)
		return false;

	CPosition bottomLeft, TopRight;
	GetDisplayArea(&bottomLeft, &TopRight);

	int currentLevel = (int)bottomLeft.DistanceTo(TopRight);

	string t = "Current zoom level ";
	t.append(std::to_string(currentLevel));

	GetPlugIn()->DisplayUserMessage("Message", "Zoom Clutter", t.c_str(), true, true, false, true, false);

	return true;
}
Beispiel #12
0
void CRegion_GUI::Refresh_Region_GUI()
{

    SRegion_Drawing_Info info	=	gpDSPEngine->Get_Region_Drawing_Info(muiRegionID);
    muiTrack_Pos				=	info.uiTrack_Start;
    mfSample_Start				=	info.uiSound_Start;
    muiSample_Duration			=	info.uiSound_Duration;
    muiSample_Fade_In			=	info.uiFade_In;
    muiSample_Fade_Out			=	info.uiFade_Out;
    mfRegion_Volume				=	info.fRegion_Volume;
    muiSample_End				=	muiSample_Duration - mfSample_Start + 1;
    mbDrawFade					=	GetPlugIn()->GetGlobalParm(giParamID_Show_Fade, giSectionGUI);

    Set_Size_X();
    Set_Pos_X();
    Update_Graphic();

}
Beispiel #13
0
void CAAmpGUI::OnTimer()
{
	
	// Out
	float fVUOut = GetPlugIn()->GetMeterSignal(0);
	
	// Lower by 3 dB to match meter, and raise by 10dB (calibration)
//	fVUOut *= 2.2387211385683396119549508524657f;
	
	// Limit
	if (fVUOut >= 0.99999) {
		fVUOut = 0.99999f;
	}
	
	// Calc the frame
	double dFrame = fVUOut * 37;
	int iFrame = (int)dFrame;
	
	dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(giCtrl_Meter))->SetFrame(iFrame);
	 
	CBaseGUI::OnTimer();
}
void CTrack_Player2::Stack_Tracks(STrack_Stack sData)
{
	
	// Hide all tracks
	for(tint32 i=0; i<giNumber_Of_Tracks; i++){
		mppTrack[i]->GetPane()->SetVisible(false);
	}
	
	ge::SSize sPaneSize;
	mpPane->GetSize(sPaneSize);

	tint32 iTrackPosY		= 0;
	tint32 iNr_Tracks		= sData.iNr_Of_Tracks;
	
	for (tint32 iPos=0; iPos<iNr_Tracks; iPos++) {
	
		tint iTrack	= sData.iTrack[iPos];
		mppTrack[iTrack]->SetPos( iTrackPosY);
		mppTrack[iTrack]->GetPane()->SetVisible(true);
		tbool bBig = (GetPlugIn()->GetGlobalParm(giParam_Track_Info_SizeY, iTrack+giSection_First_Track) != 0);
		tint32 iCY = (bBig) ? giTrack_Size_Big : giTrack_Size_Small;
		iTrackPosY += iCY;

	}
	
	
	miAccumTrackHeight = iTrackPosY;
	GetScrollPane()->SetMinSizeOfSubPane(ge::SSize(0, miAccumTrackHeight));
	
	Update_Empty_Array( sPaneSize);
	
	SMsg Msg			=	Msg_Reset_Update_Play_Head_Size_Y;
	Msg.pDataIn			=	(void*)&miAccumTrackHeight;
	SendMsgFromTop(&Msg);
	// Update grid line size
	Show_Grid();

}
Beispiel #15
0
HP_DriverPlugIn*	HP_DriverPlugIn::OpenPlugIn(const AudioDriverPlugInHostInfo& inHostInfo)
{
	//	check to see if we already have one
	HP_DriverPlugIn* theAnswer = GetPlugIn(inHostInfo.mDeviceID);
	
	if(theAnswer == NULL)
	{
		//	we don't, so make a new one
		theAnswer = HP_DriverPlugIn::CreatePlugIn(inHostInfo);
		ThrowIfNULL(theAnswer, CAException(kAudioHardwareIllegalOperationError), "HP_DriverPlugIn::OpenPlugIn: failed to create the plug-in instance");
		
		//	create the plug-in list if necessary
		if(sPlugInList == NULL)
		{
			sPlugInList = new PlugInList;
		}
		
		//	add the new plug-in to the list
		sPlugInList->push_back(theAnswer);
	}
	
	return theAnswer;
}
Beispiel #16
0
void CRegion_GUI::SetInfo(	tuint32 uiRegionID,
                            tuint64	uiSample_Pos,
                            tuint64	uiSample_Start,
                            tuint64 uiSample_Duration,
                            tint32 iColor,
                            tint32 iSize_Y,
                            CTrack_Player2* pTrack_Player2,
                            CTrack* pTrack,
                            const std::string& sName)
{
    mpKSPlugIn				=	dynamic_cast<CKSPlugIn*>(GetPlugIn());

    muiRegionID				=	uiRegionID;
    muiTrack_Pos			=	uiSample_Pos;
    mfSample_Start			=	uiSample_Start;
    muiSample_Duration		=	uiSample_Duration;
    miColor					=	iColor;
    miSize_Y				=	iSize_Y;
    mpTrack_Player2			=	pTrack_Player2;
    mpTrack					=	pTrack;
    mpLine_Start			=	NULL;
    mpLine_End				=	NULL;
    mbMouseCaptured			=	false;
//	mbSelection				=	false;
    mbExtendSelection		=	false;
    miEdit_State			=	giEdit_None;
    strcpy((char*)mPsz, sName.c_str());
    miTrimStart				= 0;
    mpText					=	NULL;

    muiSample_Fade_In		=	0;
    muiSample_Fade_Out		=	0;

    Set_Size_X();
    Set_Pos_X();
}
Beispiel #17
0
void CAAmpGUI::UpdateEngineData(tint iType, tint iExtra, tint32 iID, tint32 iValue)
{
	switch(iID) {
		
		case giParam_Tube:{
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiTube_Slot))->SetFrame(iValue ? 1:0);
			break;
		}
		case giParam_Harm:{
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiHarm_Slot))->SetFrame(iValue ? 2:0);
			break;
		}
		case giParam_Limiter:{
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiLimiter_Slot))->SetFrame(iValue ? 3:0);
			break;
		}
		
		case giParam_Swap:{
			switch(iValue){
				case 0:
					muiTube_Slot	= giCtrl_Slot1;
					muiHarm_Slot	= giCtrl_Slot2;
					muiLimiter_Slot = giCtrl_Slot3;
					break;
				case 1:
					muiTube_Slot	= giCtrl_Slot1;
					muiHarm_Slot	= giCtrl_Slot3;
					muiLimiter_Slot = giCtrl_Slot2;
					break;
				case 2:
					muiTube_Slot	= giCtrl_Slot2;
					muiHarm_Slot	= giCtrl_Slot1;
					muiLimiter_Slot = giCtrl_Slot3;
					break;
				case 3:
					muiTube_Slot	= giCtrl_Slot2;
					muiHarm_Slot	= giCtrl_Slot3;
					muiLimiter_Slot = giCtrl_Slot1;
					break;
				case 4:
					muiTube_Slot	= giCtrl_Slot3;
					muiHarm_Slot	= giCtrl_Slot1;
					muiLimiter_Slot = giCtrl_Slot2;
					break;
				case 5:
					muiTube_Slot	= giCtrl_Slot3;
					muiHarm_Slot	= giCtrl_Slot2;
					muiLimiter_Slot = giCtrl_Slot1;
					break;
			}
			
			tbool bOn	= GetPlugIn()->GetGlobalParm(giParam_Tube, 0);
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiTube_Slot))->SetFrame(bOn ? 1:0);
			
			bOn	= GetPlugIn()->GetGlobalParm(giParam_Harm, 0);
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiHarm_Slot))->SetFrame(bOn ? 2:0);
			
			bOn	= GetPlugIn()->GetGlobalParm(giParam_Limiter, 0);
			dynamic_cast<ge::IBitmap*>(mpWindow->GetControl(muiLimiter_Slot))->SetFrame(bOn ? 3:0);
			
			break;
		}
	}
			
	
}
void CKSSplashScreen::GetName(tchar* psz)
{
	strcpy((char*)psz, GetPlugIn()->GetProductName().c_str());
}
void CKSSplashScreen::Destroy()
{
	GetPlugIn()->GUIDestroyed(dynamic_cast<CBaseGUI*>(this));

	delete dynamic_cast<CKS_TrackEditor*>(this);
}
void CVST2KSPIGUI::Destroy()
{
	GetPlugIn()->GUIDestroyed(dynamic_cast<CBaseGUI*>(this));

	delete dynamic_cast<CVST2KSPIGUI*>(this);
}
void CKSPlugInGUIPane::OnCloseGUI()
{
	mpEffectPane->OnCloseGUI();

	dynamic_cast<CKSPlugIn*>(GetPlugIn())->GetPlugInManager()->WindowClosed(miSectionID, miInsertIndex);
}
Beispiel #22
0
void CDPhaserGUI::GetName(tchar* psz)
{
	strcpy((char*)psz, ((CBasePlugIn*)GetPlugIn())->GetProductName().c_str());
}
Beispiel #23
0
void CDPhaserGUI::Destroy()
{
	GetPlugIn()->GUIDestroyed(dynamic_cast<CBaseGUI*>(this));

	delete dynamic_cast<CDPhaserGUI*>(this);
}
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);
			
		}
	}

}
Beispiel #25
0
tint32 CRegion_GUI::Find_Tool()
{
    return	GetPlugIn()->GetGlobalParm(giParamID_Tool_Selected, giSectionGUI);
}
void CTrack_Player2::Update_Zoom()
{

	
	mfSamples_Pr_32						=	mpKSPlugIn->GetSamples_Pr_32();
	tfloat64 iMin_Samples_Pr_Gridline	=	giMin_Pix_Pr_Gridline * mpKSPlugIn->GetSamplesPrPixel();
	
	tint32 iGrid = GetPlugIn()->GetGlobalParm(giParamID_KS_Snap_To, giSectionGlobal);
	
	
	/*
	 SMsg Msg			=	Msg_Set_Grid;
	 SendMsgFromTop(&Msg);
	 }
	 */

	
	
	// Dont draw gridlines if they are to close to each other
	mbDraw_32	= mfSamples_Pr_32		>= iMin_Samples_Pr_Gridline? true: false;
	mbDraw_16	= mfSamples_Pr_32 * 2	>= iMin_Samples_Pr_Gridline? true: false;
	mbDraw_8	= mfSamples_Pr_32 * 4	>= iMin_Samples_Pr_Gridline? true: false;
	mbDraw_4	= mfSamples_Pr_32 * 8	>= iMin_Samples_Pr_Gridline? true: false;
	mbDraw_2	= mfSamples_Pr_32 * 16	>= iMin_Samples_Pr_Gridline? true: false;
	mbDraw_1	= mfSamples_Pr_32 * 32	>= iMin_Samples_Pr_Gridline? true: false;
	
	switch(iGrid){
		case 1:
			break;
		case 2:
			mbDraw_32	= false;
			break;
		case 4:
			mbDraw_32	= false;
			mbDraw_16	= false;
			break;
		case 8:
			mbDraw_32	= false;
			mbDraw_16	= false;
			mbDraw_8	= false;
			break;
		case 16:
			mbDraw_32	= false;
			mbDraw_16	= false;
			mbDraw_8	= false;
			mbDraw_4	= false;
			break;
		case 32:
			mbDraw_32	= false;
			mbDraw_16	= false;
			mbDraw_8	= false;
			mbDraw_4	= false;
			mbDraw_2	= false;
			break;
	}
		
	
	if(mbDraw_32)		mfGrid_In_Samples =	 mfSamples_Pr_32;
	else if(mbDraw_16)	mfGrid_In_Samples =  mfSamples_Pr_32 * 2.0f;
	else if(mbDraw_8)	mfGrid_In_Samples =  mfSamples_Pr_32 * 4.0f;
	else if(mbDraw_4)	mfGrid_In_Samples =  mfSamples_Pr_32 * 8.0f;
	else if(mbDraw_2)	mfGrid_In_Samples =  mfSamples_Pr_32 * 16.0f;
	else if(mbDraw_1)	mfGrid_In_Samples =  mfSamples_Pr_32 * 32.0f; 
	
	mpKSPlugIn->SetGridLinesInSamples(mfGrid_In_Samples);
}
void CTrack_Player2::Draw_Grid()
{
	GetPlugIn()->GetGlobalParm(giParamID_Grid, giSectionGUI) ? Show_Grid():Hide_Grid();
}
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 CZoomClutterRadarScreen::OnAsrContentLoaded(bool Loaded) {
	ZoomData.clear();
	const char * raw_data;
	CString str;
	
	GetPlugIn()->SelectActiveSectorfile();

	// We loop through each entry in the ASR
	for (int i = 1; ; i++)
	{
		// variable name
		str.Format("ZOOM%d", i);

		// get it from ASR
		if ((raw_data = GetDataFromAsr(str)) == NULL)
			break;

		// Each line is formated this way "(ZOOM%ID):TYPE:NAME:LEVEL"
		vector<string> data = split(string(raw_data), ':');

		string type = data.at(0);
		string name = data.at(1);
		int level = atoi(data.at(2).c_str());

		int ElementType = EuroScopePlugIn::SECTOR_ELEMENT_ALL;

		if (startsWith("GEO", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_GEO;
		if (startsWith("AIRPORT", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_AIRPORT;
		if (startsWith("AIRSPACE", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_AIRSPACE;
		if (startsWith("ARTC", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_ARTC;
		if (startsWith("FIX", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_FIX;
		if (startsWith("FREETEXT", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_FREE_TEXT;
		if (startsWith("HIGHAIRWAY", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_HIGH_AIRWAY;
		if (startsWith("HIGHARTC", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_HIGH_ARTC;
		if (startsWith("INFO", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_INFO;
		if (startsWith("LOWAIRWAY", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_LOW_AIRWAY;
		if (startsWith("LOWARTC", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_LOW_ARTC;
		if (startsWith("NDB", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_NDB;
		if (startsWith("NUMBER", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_NUMBER;
		if (startsWith("POSITION", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_POSITION;
		if (startsWith("RADARS", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_RADARS;
		if (startsWith("REGIONS", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_REGIONS;
		if (startsWith("RUNWAY", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_RUNWAY;
		if (startsWith("SID", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_SID;
		if (startsWith("STAR", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_STAR;
		if (startsWith("VOR", type.c_str()))
			ElementType = EuroScopePlugIn::SECTOR_ELEMENT_VOR;
		
		CSectorElement element;
		for (element = GetPlugIn()->SectorFileElementSelectFirst(ElementType);
			element.IsValid();
			element = GetPlugIn()->SectorFileElementSelectNext(element, ElementType))
		{
			string t = element.GetName();
			if (t == name) {
				ZoomData.insert(std::make_pair(level, element));
				break;
			}
		}
	}
}
void CKSExportForWebGUIPane::Init()
{
    mpPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn());

    mpPane = ge::IPane::Create();
    mpPane->SetSize(ge::SSize(541,582));

    //-------------------------------
    // Backdrop for Export
    CreateBitmap(ge::IControl::giNoID, IDB_Back_Export_For_Web, ge::SPos(0, 0));


    ge::SPos pos(160,30);


    // URL
    mpTextUrl = CreateDisplay(	giCtrl_CC_License_URL_Txt,
                                pos,
                                ge::SSize(344, 12),
                                CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)),
                                true);

    mpTextUrl->SetHorzAlignment(ge::IText::HorzAlignLeft);
    mpTextUrl->SetClicksOutsideAsSuccess();

    // Author
    pos.iY += 20;
    mpTextAuthor = CreateDisplay(	giCtrl_CC_License_Author_Txt,
                                    pos,
                                    ge::SSize(344, 12),
                                    CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)),
                                    true);

    mpTextAuthor->SetHorzAlignment(ge::IText::HorzAlignLeft);
    mpTextAuthor->SetClicksOutsideAsSuccess();

    // Status
    pos.iY += 20;
    mpTextStatus = CreateDisplay(	giCtrl_CC_License_Status_Txt,
                                    pos,
                                    ge::SSize(344, 12),
                                    CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)),
                                    true);

    mpTextStatus->SetHorzAlignment(ge::IText::HorzAlignLeft);
    mpTextStatus->SetClicksOutsideAsSuccess();


//	Create2StateButton(giCtrl_Delay_Power, IDB_Button_Power, ge::SPos(25, 36), true);


    pos.iX = 32;
    pos.iY = 132;

    mpSetup_Radio_Button = CreateRadioButtonsGroup(giCtrl_CC_License_Radio_Button, ge::SPos(0,0) );
    // Account button
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);
    pos.iY += 84;
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);
    pos.iY += 84;
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);
    pos.iY = 132;
    pos.iX = 226;
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);
    pos.iY += 84;
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);
    pos.iY += 84;
    CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true);


    pos.iY = 162;
    pos.iX = 60;
    ge::SSize UrlSize(200, 18);
    // BY
    mpBY_URL	=	ge::IURL::Create();
    mpBY_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[0]);

    mpBY_URL->SetSize(UrlSize);
//	mpBY_URL->ActivateHandCursor();
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_URL), pos);
    pos.iY += 84;

    //BY SA
    mpBY_SA_URL	=	ge::IURL::Create();
    mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[1]);
    mpBY_SA_URL->SetSize(UrlSize);
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos);
    pos.iY += 84;

    //BY ND
    mpBY_SA_URL	=	ge::IURL::Create();
    mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[2]);
    mpBY_SA_URL->SetSize(UrlSize);
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos);


    pos.iY = 162;
    pos.iX = 250;

    // BY NC
    mpBY_URL	=	ge::IURL::Create();
    mpBY_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[3]);

    mpBY_URL->SetSize(UrlSize);
//	mpBY_URL->ActivateHandCursor();
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_URL), pos);
    pos.iY += 84;

    //BY NC SA
    mpBY_SA_URL	=	ge::IURL::Create();
    mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[4]);
    mpBY_SA_URL->SetSize(UrlSize);
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos);
    pos.iY += 84;

    //BY NC ND
    mpBY_SA_URL	=	ge::IURL::Create();
    mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[5]);
    mpBY_SA_URL->SetSize(UrlSize);
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos);

    pos.iY = 563;
    pos.iX = 45;
    //Creative Commons
    mpBY_SA_URL	=	ge::IURL::Create();
    mpBY_SA_URL->Init(ge::IControl::giNoID,(tchar*)"http://creativecommons.org/");
    mpBY_SA_URL->SetSize(UrlSize);
    mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos);


    Prepare_Popups();

    // Compression
    ge::IDropDownListBox* pPop = CreatePop( giCtrl_Export_Compression_Popup, IDB_Button_Popup,  mpCompression_Popup, ge::SPos(364, 521), mpPane);
    pPop->SetValue(meQuality);

    // Cancel / Export
    CreateButton(giCtrl_Cancel_ExportForWeb, IDB_Button_Cancel, ge::SPos(402, 550), false);
    CreateButton(giCtrl_ExportForWeb, IDB_Button_Export, ge::SPos(402+68, 550), false);

    mpLicense =CreateBitmapVU(ge::IControl::giNoID, IDB_License, ge::SPos(27, 368), 6);
    mpLicense->SetFrame(0);
} // Init