@@ -1,12 +1,14 @@ | |||||
VERSION := 0.5.0 | VERSION := 0.5.0 | ||||
FLTK_LIBS := `fltk-config --ldflags` | FLTK_LIBS := `fltk-config --ldflags` | ||||
JACK_LIBS := `pkg-config --libs jack` | |||||
SNDFILE_LIBS := `pkg-config --libs sndfile` | |||||
JACK_LIBS := `pkg-config --libs jack` | |||||
SNDFILE_LIBS := `pkg-config --libs sndfile` | |||||
LASH_LIBS := `pkg-config --libs lash-1.0` | |||||
LASH_CFLAGS := `pkg-config --cflags lash-1.0` | |||||
CXXFLAGS := -DVERSION=\"$(VERSION)\" -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions | |||||
CXXFLAGS := $(LASH_CFLAGS) -DVERSION=\"$(VERSION)\" -ggdb -Wextra -Wno-missing-field-initializers -O0 -fno-rtti -fno-exceptions | |||||
all: makedepend FL Timeline Mixer | all: makedepend FL Timeline Mixer | ||||
@@ -0,0 +1,101 @@ | |||||
/*******************************************************************************/ | |||||
/* Copyright (C) 2008 Jonathan Moore Liles */ | |||||
/* */ | |||||
/* This program is free software; you can redistribute it and/or modify it */ | |||||
/* under the terms of the GNU General Public License as published by the */ | |||||
/* Free Software Foundation; either version 2 of the License, or (at your */ | |||||
/* option) any later version. */ | |||||
/* */ | |||||
/* This program is distributed in the hope that it will be useful, but WITHOUT */ | |||||
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ | |||||
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */ | |||||
/* more details. */ | |||||
/* */ | |||||
/* You should have received a copy of the GNU General Public License along */ | |||||
/* with This program; see the file COPYING. If not,write to the Free Software */ | |||||
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |||||
/*******************************************************************************/ | |||||
#include "LASH_Client.H" | |||||
#include <lash/lash.h> | |||||
#define _client (static_cast<lash_client_t*>(_void)) | |||||
#include "debug.h" | |||||
LASH_Client::LASH_Client ( ) | |||||
{ | |||||
_void = NULL; | |||||
} | |||||
LASH_Client::~LASH_Client ( ) | |||||
{ | |||||
/* TODO: anything? */ | |||||
} | |||||
bool | |||||
LASH_Client::init ( const char *jack_name, const char *long_name, int *argc, char ***argv ) | |||||
{ | |||||
MESSAGE( "Initializing LASH" ); | |||||
if ( ! ( _void = lash_init( lash_extract_args( argc, argv ), jack_name, | |||||
LASH_Config_File, LASH_PROTOCOL( 2, 0 ) ) ) ) | |||||
return false; | |||||
/* register name */ | |||||
lash_jack_client_name( _client, jack_name ); | |||||
lash_event_t *e = lash_event_new_with_type( LASH_Client_Name ); | |||||
lash_event_set_string( e, long_name ); | |||||
lash_send_event( _client, e ); | |||||
return true; | |||||
} | |||||
/** process any queued events */ | |||||
void | |||||
LASH_Client::poll ( void ) | |||||
{ | |||||
lash_event_t *e; | |||||
while ( ( e = lash_get_event( _client ) ) ) | |||||
{ | |||||
const char *name = lash_event_get_string( e ); | |||||
switch ( lash_event_get_type( e ) ) | |||||
{ | |||||
case LASH_Save_File: | |||||
{ | |||||
MESSAGE( "LASH wants us to save \"%s\"", name ); | |||||
handle_save_file( name ); | |||||
lash_send_event( _client, lash_event_new_with_type( LASH_Save_File ) ); | |||||
break; | |||||
} | |||||
case LASH_Restore_File: | |||||
{ | |||||
MESSAGE( "LASH wants us to load \"%s\"", name ); | |||||
if ( ! handle_load_file( name ) ) | |||||
/* FIXME: should we tell lash that we couldn't load the song? */; | |||||
lash_send_event( _client, lash_event_new_with_type( LASH_Restore_File ) ); | |||||
break; | |||||
} | |||||
case LASH_Quit: | |||||
MESSAGE( "LASH wants us to quit" ); | |||||
handle_quit(); | |||||
break; | |||||
default: | |||||
WARNING( "unhandled LASH event" ); | |||||
} | |||||
lash_event_destroy( e ); | |||||
} | |||||
} |
@@ -0,0 +1,49 @@ | |||||
/*******************************************************************************/ | |||||
/* Copyright (C) 2008 Jonathan Moore Liles */ | |||||
/* */ | |||||
/* This program is free software; you can redistribute it and/or modify it */ | |||||
/* under the terms of the GNU General Public License as published by the */ | |||||
/* Free Software Foundation; either version 2 of the License, or (at your */ | |||||
/* option) any later version. */ | |||||
/* */ | |||||
/* This program is distributed in the hope that it will be useful, but WITHOUT */ | |||||
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ | |||||
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */ | |||||
/* more details. */ | |||||
/* */ | |||||
/* You should have received a copy of the GNU General Public License along */ | |||||
/* with This program; see the file COPYING. If not,write to the Free Software */ | |||||
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |||||
/*******************************************************************************/ | |||||
/* generic master class for interfacing with LASH... */ | |||||
#pragma once | |||||
class LASH_Client | |||||
{ | |||||
/* to avoid including the lash header here... */ | |||||
void *_void; | |||||
protected: | |||||
virtual bool handle_load_file ( const char *path ) = 0; | |||||
virtual bool handle_save_file ( const char *path ) = 0; | |||||
virtual bool handle_quit ( void ) = 0; | |||||
public: | |||||
LASH_Client ( ); | |||||
virtual ~LASH_Client ( ); | |||||
bool init ( const char *jack_name, const char *full_name, int *argc, char ***argv ); | |||||
void poll ( void ); | |||||
void project_save ( void ); | |||||
void project_quit ( void ); | |||||
/* TODO: project_add, project_remove, project_dir, project_name, percentage */ | |||||
}; |
@@ -3,6 +3,7 @@ | |||||
Timeline_VERSION := 0.5.0 | Timeline_VERSION := 0.5.0 | ||||
Timeline_SRCS= \ | Timeline_SRCS= \ | ||||
Timeline/LASH_Client.C \ | |||||
Timeline/Annotation_Region.C \ | Timeline/Annotation_Region.C \ | ||||
Timeline/Audio_File.C \ | Timeline/Audio_File.C \ | ||||
Timeline/Audio_File_SF.C \ | Timeline/Audio_File_SF.C \ | ||||
@@ -40,7 +41,7 @@ Timeline_OBJS:=$(Timeline_SRCS:.C=.o) | |||||
$(Timeline_OBJS): Makefile | $(Timeline_OBJS): Makefile | ||||
Timeline_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(SNDFILE_LIBS) | |||||
Timeline_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(SNDFILE_LIBS) $(LASH_LIBS) | |||||
Timeline/timeline: $(Timeline_OBJS) FL | Timeline/timeline: $(Timeline_OBJS) FL | ||||
$(CXX) $(CXXFLAGS) $(INCLUDES) $(Timeline_LIBS) $(Timeline_OBJS) -o $@ -LFL -lfl_widgets | $(CXX) $(CXXFLAGS) $(INCLUDES) $(Timeline_LIBS) $(Timeline_OBJS) -o $@ -LFL -lfl_widgets | ||||