Browse Source

Mixer: Implement Project/Open menu option.

tags/non-daw-v1.1.0
Jonathan Moore Liles 13 years ago
parent
commit
bf376d9171
5 changed files with 37 additions and 10 deletions
  1. +4
    -0
      FL/Fl_Flowpack.H
  2. +24
    -3
      Mixer/Mixer.C
  3. +3
    -0
      Mixer/Mixer_Strip.C
  4. +1
    -1
      Mixer/Project.C
  5. +5
    -6
      nonlib/Loggable.C

+ 4
- 0
FL/Fl_Flowpack.H View File

@@ -36,6 +36,10 @@ public:
_max_width = _hspacing = _vspacing = 0;
}

virtual ~Fl_Flowpack ( )
{
}

int max_width ( void ) const { return _max_width; }

void vspacing ( int v ) { _vspacing = v; }


+ 24
- 3
Mixer/Mixer.C View File

@@ -26,6 +26,7 @@
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/fl_ask.H>
#include <FL/Fl_File_Chooser.H>
#include "New_Project_Dialog.H"
#include "Engine/Engine.H"
#include "FL/Fl_Flowpack.H"
@@ -78,6 +79,26 @@ void Mixer::cb_menu(Fl_Widget* o) {
// write_line( user_config_dir, "default_path", default_path );

}
else if (! strcmp( picked, "&Project/&Open" ) )
{
char *path = NULL;

// read_line( user_config_dir, "default_path", &path );

const char *name = fl_dir_chooser( "Open Project", path, NULL );

free( path );

mixer->hide();

if ( int err = Project::open( name ) )
{
fl_alert( "Error opening project: %s", Project::errstr( err ) );
mixer->show();
}

mixer->show();
}
else if (! strcmp( picked, "&Project/&Save" ) )
{
Project::save();
@@ -169,8 +190,10 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :

Mixer::~Mixer ( )
{
/* FIXME: teardown */
DMESSAGE( "Destroying mixer" );

/* FIXME: teardown */
mixer_strips->clear();
}

void Mixer::resize ( int X, int Y, int W, int H )
@@ -244,8 +267,6 @@ void Mixer::remove ( Mixer_Strip *ms )

mixer_strips->remove( ms );

delete ms;

parent()->redraw();
}



+ 3
- 0
Mixer/Mixer_Strip.C View File

@@ -182,6 +182,8 @@ Mixer_Strip::~Mixer_Strip ( )
_chain = NULL;

log_destroy();

mixer->remove( this );
}

void Mixer_Strip::cb_handle(Fl_Widget* o) {
@@ -213,6 +215,7 @@ void Mixer_Strip::cb_handle(Fl_Widget* o) {
if ( Fl::event_shift() || 1 == fl_choice( "Are you sure you want to remove this strip?\n\n(this action cannot be undone)", "Cancel", "Remove", NULL ) )
{
((Mixer*)parent())->remove( this );
Fl::delete_widget( this );
}
}
else if ( o == name_field )


+ 1
- 1
Mixer/Project.C View File

@@ -179,7 +179,7 @@ Project::close ( void )
if ( ! save() )
return false;

/* Loggable::close(); */
Loggable::close();
/* // write_info(); */

_is_open = false;


+ 5
- 6
nonlib/Loggable.C View File

@@ -219,12 +219,11 @@ Loggable::close ( void )
{
DMESSAGE( "closing journal and destroying all journaled objects" );

if ( ! _fp )
return true;

fclose( _fp );

_fp = NULL;
if ( _fp )
{
fclose( _fp );
_fp = NULL;
}

if ( ! snapshot( "snapshot" ) )
WARNING( "Failed to create snapshot" );


Loading…
Cancel
Save