void sf2InstrumentView::modelChanged() { sf2Instrument * k = castModel<sf2Instrument>(); m_bankNumLcd->setModel( &k->m_bankNum ); m_patchNumLcd->setModel( &k->m_patchNum ); m_gainKnob->setModel( &k->m_gain ); m_reverbButton->setModel( &k->m_reverbOn ); m_reverbRoomSizeKnob->setModel( &k->m_reverbRoomSize ); m_reverbDampingKnob->setModel( &k->m_reverbDamping ); m_reverbWidthKnob->setModel( &k->m_reverbWidth ); m_reverbLevelKnob->setModel( &k->m_reverbLevel ); m_chorusButton->setModel( &k->m_chorusOn ); m_chorusNumKnob->setModel( &k->m_chorusNum ); m_chorusLevelKnob->setModel( &k->m_chorusLevel ); m_chorusSpeedKnob->setModel( &k->m_chorusSpeed ); m_chorusDepthKnob->setModel( &k->m_chorusDepth ); connect( k, SIGNAL( fileChanged() ), this, SLOT( updateFilename() ) ); connect( k, SIGNAL( fileLoading() ), this, SLOT( invalidateFile() ) ); updateFilename(); }
void DatabaseWidget::switchToOpenDatabase(const QString& fileName, const QString& password, const QString& keyFile) { updateFilename(fileName); switchToOpenDatabase(fileName); m_databaseOpenWidget->enterKey(password, keyFile); }
bool MirandaSkinnedDialog::finishedConfiguring() { updateFilename(); if (getDefaultState() == NULL || getOpts() == NULL) return false; return true; }
void MirandaSkinnedDialog::setSkinName(const TCHAR *name) { if (skinName == name) return; skinName = name; setSettting("Skin", skinName.c_str(), true); updateFilename(); }
void changeFileExtension(in_file_struct* fileStructPtr,char * newExtensionStr){ int sz_newExtension = strlen(newExtensionStr), sz_oldExtension = strlen(fileStructPtr->extension); if(sz_newExtension != sz_oldExtension){ printf("YOu here exentensions not equal\n"); // fileStructPtr = (sz_oldExtension>0 ? realloc(fileStructPtr->extension,sz_newExtension) : malloc(sz_newExtension)) + 1; fileStructPtr->extension = realloc(fileStructPtr->extension,sz_newExtension)+1; //+1 for null character. fileStructPtr->extension[sz_newExtension]='\0'; // = 0 ; } if(sz_newExtension>0){ strncpy(fileStructPtr->extension,newExtensionStr,sz_newExtension); } updateFilename(fileStructPtr); }
sf2InstrumentView::sf2InstrumentView( Instrument * _instrument, QWidget * _parent ) : InstrumentView( _instrument, _parent ) { // QVBoxLayout * vl = new QVBoxLayout( this ); // QHBoxLayout * hl = new QHBoxLayout(); sf2Instrument* k = castModel<sf2Instrument>(); connect( &k->m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); connect( &k->m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); // File Button m_fileDialogButton = new pixmapButton( this ); m_fileDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) ); m_fileDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_on" ) ); m_fileDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_off" ) ); m_fileDialogButton->move( 217, 107 ); connect( m_fileDialogButton, SIGNAL( clicked() ), this, SLOT( showFileDialog() ) ); toolTip::add( m_fileDialogButton, tr( "Open other SoundFont file" ) ); m_fileDialogButton->setWhatsThis( tr( "Click here to open another SF2 file" ) ); // Patch Button m_patchDialogButton = new pixmapButton( this ); m_patchDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) ); m_patchDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_on" ) ); m_patchDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_off" ) ); m_patchDialogButton->setEnabled( false ); m_patchDialogButton->move( 217, 125 ); connect( m_patchDialogButton, SIGNAL( clicked() ), this, SLOT( showPatchDialog() ) ); toolTip::add( m_patchDialogButton, tr( "Choose the patch" ) ); // LCDs m_bankNumLcd = new LcdSpinBox( 3, "21pink", this ); m_bankNumLcd->move(131, 62); // m_bankNumLcd->addTextForValue( -1, "---" ); // m_bankNumLcd->setEnabled( false ); m_patchNumLcd = new LcdSpinBox( 3, "21pink", this ); m_patchNumLcd->move(190, 62); // m_patchNumLcd->addTextForValue( -1, "---" ); // m_patchNumLcd->setEnabled( false ); /*hl->addWidget( m_fileDialogButton ); hl->addWidget( m_bankNumLcd ); hl->addWidget( m_patchNumLcd ); hl->addWidget( m_patchDialogButton ); vl->addLayout( hl );*/ // Next row //hl = new QHBoxLayout(); m_filenameLabel = new QLabel( this ); m_filenameLabel->setGeometry( 58, 109, 156, 11 ); m_patchLabel = new QLabel( this ); m_patchLabel->setGeometry( 58, 127, 156, 11 ); //hl->addWidget( m_filenameLabel ); // vl->addLayout( hl ); // Gain m_gainKnob = new sf2Knob( this ); m_gainKnob->setHintText( tr("Gain") + " ", "" ); m_gainKnob->move( 86, 55 ); // vl->addWidget( m_gainKnob ); // Reverb // hl = new QHBoxLayout(); m_reverbButton = new pixmapButton( this ); m_reverbButton->setCheckable( true ); m_reverbButton->move( 14, 180 ); m_reverbButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reverb_on" ) ); m_reverbButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reverb_off" ) ); toolTip::add( m_reverbButton, tr( "Apply reverb (if supported)" ) ); m_reverbButton->setWhatsThis( tr( "This button enables the reverb effect. " "This is useful for cool effects, but only works on " "files that support it." ) ); m_reverbRoomSizeKnob = new sf2Knob( this ); m_reverbRoomSizeKnob->setHintText( tr("Reverb Roomsize:") + " ", "" ); m_reverbRoomSizeKnob->move( 93, 160 ); m_reverbDampingKnob = new sf2Knob( this ); m_reverbDampingKnob->setHintText( tr("Reverb Damping:") + " ", "" ); m_reverbDampingKnob->move( 130, 160 ); m_reverbWidthKnob = new sf2Knob( this ); m_reverbWidthKnob->setHintText( tr("Reverb Width:") + " ", "" ); m_reverbWidthKnob->move( 167, 160 ); m_reverbLevelKnob = new sf2Knob( this ); m_reverbLevelKnob->setHintText( tr("Reverb Level:") + " ", "" ); m_reverbLevelKnob->move( 204, 160 ); /* hl->addWidget( m_reverbOnLed ); hl->addWidget( m_reverbRoomSizeKnob ); hl->addWidget( m_reverbDampingKnob ); hl->addWidget( m_reverbWidthKnob ); hl->addWidget( m_reverbLevelKnob ); vl->addLayout( hl ); */ // Chorus // hl = new QHBoxLayout(); m_chorusButton = new pixmapButton( this ); m_chorusButton->setCheckable( true ); m_chorusButton->move( 14, 226 ); m_chorusButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "chorus_on" ) ); m_chorusButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "chorus_off" ) ); toolTip::add( m_reverbButton, tr( "Apply chorus (if supported)" ) ); m_chorusButton->setWhatsThis( tr( "This button enables the chorus effect. " "This is useful for cool echo effects, but only works on " "files that support it." ) ); m_chorusNumKnob = new sf2Knob( this ); m_chorusNumKnob->setHintText( tr("Chorus Lines:") + " ", "" ); m_chorusNumKnob->move( 93, 206 ); m_chorusLevelKnob = new sf2Knob( this ); m_chorusLevelKnob->setHintText( tr("Chorus Level:") + " ", "" ); m_chorusLevelKnob->move( 130 , 206 ); m_chorusSpeedKnob = new sf2Knob( this ); m_chorusSpeedKnob->setHintText( tr("Chorus Speed:") + " ", "" ); m_chorusSpeedKnob->move( 167 , 206 ); m_chorusDepthKnob = new sf2Knob( this ); m_chorusDepthKnob->setHintText( tr("Chorus Depth:") + " ", "" ); m_chorusDepthKnob->move( 204 , 206 ); /* hl->addWidget( m_chorusOnLed ); hl->addWidget( m_chorusNumKnob); hl->addWidget( m_chorusLevelKnob); hl->addWidget( m_chorusSpeedKnob); hl->addWidget( m_chorusDepthKnob); vl->addLayout( hl ); */ setAutoFillBackground( true ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); updateFilename(); }
void DatabaseWidget::switchToImportKeepass1(const QString& fileName) { updateFilename(fileName); m_keepass1OpenWidget->load(fileName); setCurrentWidget(m_keepass1OpenWidget); }
void DatabaseWidget::switchToOpenDatabase(const QString& fileName) { updateFilename(fileName); m_databaseOpenWidget->load(fileName); setCurrentWidget(m_databaseOpenWidget); }
/* This correction sets the max of each peak to be approximately equal to the * others. It is meant as a small experiment in response to an unfortunate * pattern noticed in the scans after the correction is applied. * * Determine the correction to be applied to emission spectra from the * integrating sphere, by printing the inverse of the sum (with an averaged * baseline subtracted from each point) of events from each scan. * * Data was collected using a high pressure xenon lamp with two monochromators * to select one exitation wavelength, which traveled through a light tube * to an integrating sphere which contained a borosilicate vial of cyclohexane. * Reflected light went through another light tube and was recorded by a PMT * behind an emission monochromator with FeliXGX data acquisition software. * * 39 emission scans were taken, with a +-15nm range from the excitation * wavelength. Gain was set to 6.8V, slit widths were all 1mm, integration * time was 10 seconds. Default excitation correction was previously applied * to data. * * An offset between reported wavelengths has been observed: the sample is * excited at the desired excitation wavelength minus ~3 nm, which the emission * monochromator reports as -2 nm. */ void CyhxEmissionCorrectionB() { double corr[NUM_FILES]; double w[NUM_FILES]; char filename[LINE_SIZE]; int wavelength = 300; for (int i = 0; i < NUM_FILES; i++) { double baseline = 0.0; double x[NUM_POINTS + 1]; double y[NUM_POINTS + 1]; sprintf(filename, "data/emcorr w cyhx/%d.txt", wavelength); FILE *data = fopen(filename, "r"); char line[LINE_SIZE]; char* p; int index = 0; double xmax = 0, ymax = 0; for (int h = 0; h < HEADER_SIZE; h++) fgets(line, sizeof(line), data); while(fgets(line, sizeof(line), data)) { strtok(line, "\n"); if (index >= NUM_POINTS) break; double xval = strtod(line, &p); double yval = atof(p); x[index] = xval; y[index] = yval; if (yval > ymax) { xmax = xval; ymax = yval; } if (index < NUM_AVG || index >= NUM_POINTS - NUM_AVG) { baseline += yval; } index++; } fclose(data); baseline /= (NUM_AVG * 2); corr[i] = 250000 / (ymax - baseline); printf("xmax %d baseline %f\n", xmax, baseline); w[i] = xmax; updateFilename(&wavelength); } FILE* result = fopen("correction/CyhxCorrectionDataB.txt", "w"); for (int k = 0; k < NUM_FILES; k++) { printf("%dnm: %f\n", w[k], corr[k]); sprintf(line, "%d %f\n", w[k], corr[k]); fputs(line, result); } fclose(result); /* VARIATION.C was used to calculate the average fraction of the * standard deviation over the mean photon count for each of the three * excitation corrections. This is the factor used for error bars. */ double err[NUM_FILES + 1]; for (int n = 0; n < NUM_FILES; n++) { err[n] = 0.04148067 * corr[n]; } TGraphErrors* g = new TGraphErrors(39, w, corr, NULL, err); g->SetTitle("Emission Corrections"); g->SetLineColor(4); g->Draw(); }