diff --git a/Control.cpp b/Control.cpp index 502b657..0e6b763 100644 --- a/Control.cpp +++ b/Control.cpp @@ -62,6 +62,7 @@ bool Control::set_input_filename(string filename,FILE_TYPE intype){ if (intype==FILE_VORBIS) ai=new VorbisInputS; if (intype==FILE_MP3) ai=new MP3InputS; if (intype==FILE_WAV) ai=new AInputS; + if (intype==FILE_FLAC) ai=new AInputS; if (!ai) return false; wavinfo.filename=filename; wavinfo.intype=intype; diff --git a/GUI.fl b/GUI.fl index febb297..d21a479 100644 --- a/GUI.fl +++ b/GUI.fl @@ -1,46 +1,46 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0110 -header_name {.h} +version 1.0110 +header_name {.h} code_name {.cxx} decl {//Copyright (c) Nasca Octavian Paul. Released under GNU General Public License version 2} {public -} +} -decl {\#include } {} +decl {\#include } {} decl {\#include } {public -} +} decl {\#include } {public -} +} decl {\#include } {public -} +} decl {\#include } {public -} +} decl {\#include } {public -} +} decl {\#include } {public -} +} -decl {\#include} {} +decl {\#include} {} -decl {\#include } {} +decl {\#include } {} -decl {\#include } {} +decl {\#include } {} -decl {\#include } {} +decl {\#include } {} decl {\#include "Control.h"} {public -} +} decl {\#include "FreeEditUI.h"} {public -} +} decl {\#include "version.h"} {public -} +} Function {hex4n(char c)} {return_type int } { @@ -49,7 +49,7 @@ if ((c>='0')&&(c<='9')) return (c-'0'); if ((c>='A')&&(c<='F')) return (c-'A')+10; return 0;} {} -} +} Function {unescape(std::string s)} {return_type {std::string} } { @@ -73,7 +73,7 @@ while (skcopy_label(control.get_input_filename_and_info().c_str()); @@ -140,7 +141,7 @@ render_percent_slider->activate(); cancel_render_button->activate(); //char defaultfile[FL_PATH_MAX]; //fl_filename_absolute(defaultfile,control.get_recommanded_output_filename().c_str()); -Fl_File_Chooser *fc=new Fl_File_Chooser(NULL,"Wave files (*.wav)\\tOgg Vorbis (*.ogg)",Fl_File_Chooser::CREATE,"Render to audio file..."); +Fl_File_Chooser *fc=new Fl_File_Chooser(NULL,"Wave files (*.wav)\\tOgg Vorbis (*.ogg)\\tFLAC (*.flac)",Fl_File_Chooser::CREATE,"Render to audio file..."); fc->preview(0); fc->filter_value(0); @@ -151,7 +152,7 @@ while (fc->visible()){ }; const char *newfile = fc->value(); - if (newfile != NULL) { + if (newfile != NULL) { if (file_exists(newfile)){ if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return; }; @@ -200,10 +201,10 @@ rendering=false;} {} } { MenuItem {} { label {Open audio file...} - callback {char *newfile = fl_file_chooser("Open Audio(ogg,wav,mp3) File?", NULL, NULL); + callback {char *newfile = fl_file_chooser("Open Audio(ogg,wav,mp3,flac) File?", NULL, NULL); if (newfile != NULL) { open_input_file(newfile); - + }; selection_pos1->value(0.0); selection_pos2->value(100.0); @@ -225,7 +226,7 @@ render();} if (newfile != NULL) { set_mode(STOP); control.stopplay(); - + if (!control.load_parameters(newfile)){ fl_alert("Error: Could not load parameter file:\\n%s",newfile); }; @@ -805,14 +806,14 @@ control.stopplay();} play_button->labelcolor(FL_BLACK); //mode_choice->activate(); break; - + case PLAY: play_button->labelcolor(FL_RED); //mode_choice->deactivate(); fftsize_slider->labelcolor(FL_BLACK); freeze_button->activate(); break; - + case FREEZE: if (control.is_freeze()) freeze_button->labelcolor(FL_GREEN); else freeze_button->labelcolor(FL_BLACK); @@ -836,7 +837,7 @@ resolution_box->copy_label(control.get_fftresolution_info().c_str()); bool may_render=false; if (infilename_output->label()!=NULL){ - if (strlen(infilename_output->label())!=0) + if (strlen(infilename_output->label())!=0) may_render=true; }; if (!rendering){//do not change the status of render button while rendering @@ -938,7 +939,7 @@ Fl::add_timeout(1.0/3.0,tick,v);//3 fps} {} decl {bool playing_for_button;} {} decl {bool rendering;} {} decl {bool eof_for_button;} {} -} +} Function {file_exists(const char *filename)} {return_type bool } { @@ -947,7 +948,7 @@ int i = stat ( filename, &buf ); // File exists if ( i == 0 ) return true; else return false;} {} -} +} Function {main(int argc, char *argv[])} {open return_type int } { @@ -970,4 +971,4 @@ Fl::run(); delete gui; return 0;} {} -} +} diff --git a/globals.h b/globals.h index c03042e..3f3e219 100644 --- a/globals.h +++ b/globals.h @@ -29,7 +29,7 @@ void sleep(int ms); #define ZERO(data,size) {char *data_=(char *) data;for (int i=0;i