Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 1032:b987cc23a26c imaf_enc
removed imaf sliders
author | alo |
---|---|
date | Tue, 14 Jul 2015 15:04:46 +0100 |
parents | 60d3575f8016 |
children | 5e6e1e074080 |
comparison
equal
deleted
inserted
replaced
688:ddfa8ce5bc2d | 1032:b987cc23a26c |
---|---|
2927 if (orig == "") orig = "."; | 2927 if (orig == "") orig = "."; |
2928 else orig = QFileInfo(orig).absoluteDir().canonicalPath(); | 2928 else orig = QFileInfo(orig).absoluteDir().canonicalPath(); |
2929 | 2929 |
2930 QString path = getOpenFileName(FileFinder::AnyFile); | 2930 QString path = getOpenFileName(FileFinder::AnyFile); |
2931 | 2931 |
2932 if (path.isEmpty()) return; | 2932 if (path.isEmpty()) return; |
2933 | 2933 |
2934 FileOpenStatus status = open(path, ReplaceSession); | 2934 FileOpenStatus status = open(path, ReplaceSession); |
2935 | 2935 |
2936 if (status == FileOpenFailed) { | 2936 if (status == FileOpenFailed) { |
2937 emit hideSplash(); | 2937 emit hideSplash(); |
2941 emit hideSplash(); | 2941 emit hideSplash(); |
2942 QMessageBox::critical(this, tr("Failed to open file"), | 2942 QMessageBox::critical(this, tr("Failed to open file"), |
2943 tr("<b>Audio required</b><p>Unable to load layer data from \"%1\" without an audio file.<br>Please load at least one audio file before importing annotations.").arg(path)); | 2943 tr("<b>Audio required</b><p>Unable to load layer data from \"%1\" without an audio file.<br>Please load at least one audio file before importing annotations.").arg(path)); |
2944 } | 2944 } |
2945 | 2945 |
2946 files_paths[0] = path; | 2946 files_paths[0] = path; |
2947 QTextStream out(stdout); | 2947 QTextStream out(stdout); |
2948 out << path; | 2948 out << path; |
2949 | 2949 |
2950 } | 2950 } |
2951 | 2951 |
2952 void | 2952 void |
2953 MainWindow::openLocation() | 2953 MainWindow::openLocation() |
4900 } | 4900 } |
4901 | 4901 |
4902 void MainWindow::importIMAF() | 4902 void MainWindow::importIMAF() |
4903 { | 4903 { |
4904 | 4904 |
4905 QString filename; | |
4906 int haslyrics; // if this variable != 2 -> there are lyrics | 4905 int haslyrics; // if this variable != 2 -> there are lyrics |
4907 filename = QFileDialog::getOpenFileName(this, | 4906 QString path = getOpenFileName(FileFinder::IMAFile); |
4908 tr("Import IMAF"), "/", tr("IMAF (*.ima)")); | 4907 |
4909 | 4908 if (path.isEmpty()) return; |
4910 if (filename.isEmpty()) return; | |
4911 isIMAF = true; | 4909 isIMAF = true; |
4912 | 4910 |
4913 haslyrics = mainIMAFdecoder(filename); | 4911 haslyrics = mainIMAFdecoder(path); |
4914 | 4912 |
4915 openMP3IMAF(); | 4913 openMP3IMAF(); |
4916 | 4914 |
4917 if (haslyrics!=2){ | 4915 if (haslyrics!=2){ |
4918 addPaneToStack();//it creates a new pane to show the lyrics | 4916 addPaneToStack();//it creates a new pane to show the lyrics |
4936 //editCurrentLayer(); | 4934 //editCurrentLayer(); |
4937 | 4935 |
4938 //text decoder | 4936 //text decoder |
4939 unsigned char dat,dat1,dat2,dat3; | 4937 unsigned char dat,dat1,dat2,dat3; |
4940 FILE *imf; | 4938 FILE *imf; |
4941 imf = fopen (filename.toStdString().c_str(),"rb"); | 4939 imf = fopen (path.toStdString().c_str(),"rb"); |
4942 | 4940 |
4943 fseek (imf,0,SEEK_SET); | 4941 fseek (imf,0,SEEK_SET); |
4944 fseek (imf,24,SEEK_CUR); //jump to 'mdat' | 4942 fseek (imf,24,SEEK_CUR); //jump to 'mdat' |
4945 fread(&dat, sizeof(unsigned char), 1, imf); | 4943 fread(&dat, sizeof(unsigned char), 1, imf); |
4946 fread(&dat1, sizeof(unsigned char), 1, imf); | 4944 fread(&dat1, sizeof(unsigned char), 1, imf); |