Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 636:767789a78984 imaf_enc
Fix from Jesus Corral Garcia (for crashes etc)
author | Chris Cannam |
---|---|
date | Mon, 04 Nov 2013 17:17:09 +0000 |
parents | ba338234c001 |
children | f45af8d8091e |
comparison
equal
deleted
inserted
replaced
635:8e64cebd38c0 | 636:767789a78984 |
---|---|
143 int mixrule_type, mixrule_par1, mixrule_par2, mixrule_par3, mixrule_par4; | 143 int mixrule_type, mixrule_par1, mixrule_par2, mixrule_par3, mixrule_par4; |
144 int group_tracks[maxtracks], group_volume; | 144 int group_tracks[maxtracks], group_volume; |
145 QString group_descr, group_name; | 145 QString group_descr, group_name; |
146 int preset_type, fade_in; | 146 int preset_type, fade_in; |
147 | 147 |
148 bool isIMAF; | |
148 | 149 |
149 MainWindow::MainWindow(bool withAudioOutput, bool withOSCSupport) : | 150 MainWindow::MainWindow(bool withAudioOutput, bool withOSCSupport) : |
150 MainWindowBase(withAudioOutput, withOSCSupport, true), | 151 MainWindowBase(withAudioOutput, withOSCSupport, true), |
151 m_overview(0), | 152 m_overview(0), |
152 m_mainMenusCreated(false), | 153 m_mainMenusCreated(false), |
4698 | 4699 |
4699 group_descr = "Thisgroup"; | 4700 group_descr = "Thisgroup"; |
4700 | 4701 |
4701 if( ImafFileName != "" ){ //if the user press cancel the function mainIMAFencoder won´t be called | 4702 if( ImafFileName != "" ){ //if the user press cancel the function mainIMAFencoder won´t be called |
4702 mainIMAFencoder(numtracks, files_paths, ImafFileName, ImageFileName, TextFileName, | 4703 mainIMAFencoder(numtracks, files_paths, ImafFileName, ImageFileName, TextFileName, |
4703 ImafVolumeValues, has_image, selrule_type, selrule_par1, selrule_par2, | 4704 ImafVolumeValues, has_image, has_lyrics, selrule_type, selrule_par1, selrule_par2, |
4704 mixrule_type, mixrule_par1, mixrule_par2, mixrule_par3, mixrule_par4, | 4705 mixrule_type, mixrule_par1, mixrule_par2, mixrule_par3, mixrule_par4, |
4705 group_tracks, group_volume, group_name, group_descr, preset_type, fade_in); | 4706 group_tracks, group_volume, group_name, group_descr, preset_type, fade_in); |
4706 } | 4707 } |
4707 } | 4708 } |
4708 | 4709 |
4832 QString filename; | 4833 QString filename; |
4833 int haslyrics; // if this variable != 2 -> there are lyrics | 4834 int haslyrics; // if this variable != 2 -> there are lyrics |
4834 filename = QFileDialog::getOpenFileName(this, | 4835 filename = QFileDialog::getOpenFileName(this, |
4835 tr("Import IMAF"), "/", tr("IMAF (*.ima)")); | 4836 tr("Import IMAF"), "/", tr("IMAF (*.ima)")); |
4836 | 4837 |
4838 if (filename.isEmpty()) return; | |
4839 isIMAF = true; | |
4840 | |
4837 haslyrics = mainIMAFdecoder(filename); | 4841 haslyrics = mainIMAFdecoder(filename); |
4838 | 4842 |
4839 openMP3IMAF(); | 4843 openMP3IMAF(); |
4840 | 4844 |
4841 if (haslyrics!=2){ | 4845 if (haslyrics!=2){ |
4859 | 4863 |
4860 //editCurrentLayer(); | 4864 //editCurrentLayer(); |
4861 | 4865 |
4862 //text decoder | 4866 //text decoder |
4863 unsigned char dat,dat1,dat2,dat3; | 4867 unsigned char dat,dat1,dat2,dat3; |
4864 QTextStream out(stdout); | |
4865 FILE *imf; | 4868 FILE *imf; |
4866 imf = fopen (filename.toStdString().c_str(),"rb"); | 4869 imf = fopen (filename.toStdString().c_str(),"rb"); |
4867 | 4870 |
4868 fseek (imf,0,SEEK_SET); | 4871 fseek (imf,0,SEEK_SET); |
4869 fseek (imf,24,SEEK_CUR); //jump to 'mdat' | 4872 fseek (imf,24,SEEK_CUR); //jump to 'mdat' |