From 55ebb9e107e637adcedb7e26854b137a4335d606 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 24 Jan 2010 20:49:28 -0600 Subject: [PATCH] Remove (deprecated) LASH support. --- Makefile | 2 +- Timeline/LASH_Engine.C | 120 ------------------------------------ Timeline/LASH_Engine.H | 38 ------------ Timeline/TLE.fl | 15 ++--- Timeline/Timeline.H | 2 + Timeline/main.C | 13 ---- Timeline/makefile.inc | 2 +- configure | 5 +- nonlib/LASH/Client.C | 134 ----------------------------------------- nonlib/LASH/Client.H | 52 ---------------- 10 files changed, 11 insertions(+), 372 deletions(-) delete mode 100644 Timeline/LASH_Engine.C delete mode 100644 Timeline/LASH_Engine.H delete mode 100644 nonlib/LASH/Client.C delete mode 100644 nonlib/LASH/Client.H diff --git a/Makefile b/Makefile index 50040ad..1445b29 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ CFLAGS+=-DVERSION=\"$(VERSION)\" \ -DDOCUMENT_PATH=\"$(DOCUMENT_PATH)\" \ -DPIXMAP_PATH=\"$(PIXMAP_PATH)\" -CXXFLAGS += $(SNDFILE_CFLAGS) $(LASH_CFLAGS) $(FLTK_CFLAGS) $(JACK_CFLAGS) +CXXFLAGS += $(SNDFILE_CFLAGS) $(FLTK_CFLAGS) $(JACK_CFLAGS) CXXFLAGS := $(CFLAGS) $(CXXFLAGS) INCLUDES := -I. -Iutil -IFL -Inonlib diff --git a/Timeline/LASH_Engine.C b/Timeline/LASH_Engine.C deleted file mode 100644 index b3b4108..0000000 --- a/Timeline/LASH_Engine.C +++ /dev/null @@ -1,120 +0,0 @@ - -/*******************************************************************************/ -/* 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. */ -/*******************************************************************************/ - -/* Actual implementation of our side of the LASH_Engine protocol */ - -/* NOTES: Since LASH doesn't provide us with the information we - * need--when we need it--we just punt and only use LASH to save and - * load the path to the *real* project data. */ - -#include "LASH_Engine.H" -#include "Project.H" -#include "TLE.H" // all this just for quit() - -#include -#include - -extern TLE *tle; - -#include "const.h" -#include "util/debug.h" - -const float lash_poll_interval = 0.2f; - -void -LASH_Engine::timer_cb ( void *v ) -{ - ((LASH_Engine*)v)->poll(); - Fl::repeat_timeout( lash_poll_interval, &LASH_Engine::timer_cb, v ); -} - -LASH_Engine::LASH_Engine ( ) -{ - Fl::add_timeout( lash_poll_interval, &LASH_Engine::timer_cb, this ); -} - -LASH_Engine::~LASH_Engine ( ) -{ - Fl::remove_timeout( &LASH_Engine::timer_cb ); -} - -bool -LASH_Engine::handle_save_file ( const char *path ) -{ - MESSAGE( "LASH wants us to save \"%s\"", path ); - - char *name; - - asprintf( &name, "%s/project-path", path ); - - FILE *fp; - - if ( ! ( fp = fopen( name, "w" ) ) ) - { - free( name ); - return false; - } - else - free( name ); - - char project_path[ 512 ]; - - fl_filename_absolute( project_path, sizeof( project_path ), "." ); - - fwrite( project_path, strlen( project_path ), 1, fp ); - - fclose( fp ); - - return Project::save(); -} - -bool -LASH_Engine::handle_restore_file ( const char *path ) -{ - MESSAGE( "LASH wants us to load \"%s\"", path ); - - char *name; - - asprintf( &name, "%s/project-path", path ); - - FILE *fp; - - if ( ! ( fp = fopen( name, "r" ) ) ) - { - free( name ); - return false; - } - else - free( name ); - - char project_path[ 512 ]; - - fgets( project_path, sizeof( project_path ), fp ); - - fclose( fp ); - - return Project::open( project_path ) == 0; -} - -void -LASH_Engine::handle_quit ( void ) -{ - MESSAGE( "LASH wants us to quit" ); - tle->quit(); -} diff --git a/Timeline/LASH_Engine.H b/Timeline/LASH_Engine.H deleted file mode 100644 index ea2ed8f..0000000 --- a/Timeline/LASH_Engine.H +++ /dev/null @@ -1,38 +0,0 @@ - -/*******************************************************************************/ -/* 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. */ -/*******************************************************************************/ - -#pragma once - -#include "LASH/Client.H" - -class LASH_Engine : public LASH::Client -{ - - static void timer_cb ( void *v ); - -public: - - LASH_Engine ( ); - ~LASH_Engine ( ); - - bool handle_save_file ( const char *path ); - bool handle_restore_file ( const char *path ); - void handle_quit ( void ); - -}; diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 51ec783..1e7d33b 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -24,8 +24,6 @@ comment {// decl {const float STATUS_UPDATE_FREQ = 0.5f;} {} -decl {\#include "LASH_Engine.H"} {} - decl {\#include "Fl_Menu_Settings.H"} {} decl {\#include "Timeline.H"} {} @@ -67,9 +65,6 @@ decl {extern char project_display_name[256];} {global decl {extern char *user_config_dir;} {global } -decl {extern LASH_Engine *lash;} {global -} - class TLE {open } { decl {Fl_Color system_colors[3];} {} @@ -694,8 +689,8 @@ ab.run();} code0 {\#include "FL/Fl_Blinker.H"} class Fl_Blinker } - Fl_Button lash_blinker { - label LASH + Fl_Button sm_blinker { + label SM xywh {695 30 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 75 selection_color 86 labelfont 2 labelcolor 39 deactivate code0 {\#include "FL/Fl_Blinker.H"} class Fl_Blinker @@ -812,8 +807,10 @@ if ( engine->zombified() && ! zombie ) solo_blinker->value( Track::soloing() ); rec_blinker->value( transport->rolling && transport->rec_enabled() ); -lash_blinker->value( lash->enabled() ); -selected_blinker->value( timeline->nselected() );} {} +sm_blinker->value( timeline->session_manager_name() != NULL ); +sm_blinker->tooltip( timeline->session_manager_name() ); +selected_blinker->value( timeline->nselected() );} {selected + } } Function {update_cb( void *v )} {open private return_type {static void} } { diff --git a/Timeline/Timeline.H b/Timeline/Timeline.H index e72525f..d1686ac 100644 --- a/Timeline/Timeline.H +++ b/Timeline/Timeline.H @@ -145,6 +145,8 @@ public: void update_tempomap ( void ); + const char *session_manager_name ( void ) { return NULL; } + nframes_t fpp ( void ) const { return 1 << _fpp; } void range ( nframes_t start, nframes_t length ); nframes_t length ( void ) const; diff --git a/Timeline/main.C b/Timeline/main.C index 7e70b76..b05a259 100644 --- a/Timeline/main.C +++ b/Timeline/main.C @@ -43,7 +43,6 @@ #include "../FL/Boxtypes.H" #include "Project.H" -#include "LASH_Engine.H" #include "Transport.H" #include "Engine/Engine.H" @@ -52,7 +51,6 @@ Engine *engine; Timeline *timeline; Transport *transport; -LASH_Engine *lash; TLE *tle; /* TODO: put these in a header */ @@ -147,17 +145,6 @@ main ( int argc, char **argv ) * scenario requiring otherwise */ transport->stop(); - MESSAGE( "Initializing LASH" ); - lash = new LASH_Engine; - - if ( argc > 1 && ! strcmp( argv[1], "--no-lash" ) ) - { - MESSAGE( "--no-lash specified on command-line: LASH disabled." ); - shift( argv, &argc, 1 ); - } - else - lash->init( jack_name, APP_TITLE, &argc, &argv ); - MESSAGE( "Starting GUI" ); tle->run(); diff --git a/Timeline/makefile.inc b/Timeline/makefile.inc index ec0715d..90cdc54 100644 --- a/Timeline/makefile.inc +++ b/Timeline/makefile.inc @@ -12,7 +12,7 @@ Timeline_SRCS:=$(Timeline_SRCS:.fl=.C) Timeline_SRCS:=$(sort $(Timeline_SRCS)) Timeline_OBJS:=$(Timeline_SRCS:.C=.o) -Timeline_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(SNDFILE_LIBS) $(LASH_LIBS) +Timeline_LIBS := $(FLTK_LIBS) $(JACK_LIBS) $(SNDFILE_LIBS) Timeline/timeline: $(Timeline_OBJS) FL @ echo -n Linking timeline... diff --git a/configure b/configure index 1012007..d5301cf 100755 --- a/configure +++ b/configure @@ -10,11 +10,10 @@ begin begin_options ask "Installation prefix" prefix /usr/local -ask "Use the LASH Audio Session Handler" USE_LASH yes ask "Build for debugging" USE_DEBUG no using DEBUG && -{ +{ ask "Use unoptimized drawing routines" USE_UNOPTIMIZED_DRAWING no ask "Use widget for timeline" USE_WIDGET_FOR_TIMELINE no using WIDGET_FOR_TIMELINE || ask "Use singlebuffered timeline" USE_SINGLEBUFFERED_TIMELINE no @@ -29,6 +28,4 @@ require_command makedepend makedepend require_package JACK 0.103.0 jack require_package sndfile 1.0.17 sndfile -using LASH && require_package LASH 0.5.4 lash-1.0 - end diff --git a/nonlib/LASH/Client.C b/nonlib/LASH/Client.C deleted file mode 100644 index 8ca306d..0000000 --- a/nonlib/LASH/Client.C +++ /dev/null @@ -1,134 +0,0 @@ - -/*******************************************************************************/ -/* 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. */ -/*******************************************************************************/ - -/* Handler based wrapper for LASH */ - -#include "Client.H" - -/* #include "const.h" */ -/* #include "util/debug.h" */ - - - -namespace LASH -{ - - Client::Client ( ) - { - _void = 0; - } - - Client::~Client ( ) - { - /* TODO: anything? */ - } - - - -#ifdef HAVE_LASH - -#include - -#define _client (static_cast(_void)) - - bool - Client::init ( const char *jack_name, const char *long_name, int *argc, char ***argv ) - { - 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; - } - - bool - Client::enabled ( void ) - { - return lash_enabled( _client ); - } - -/** process any queued events */ - void - Client::poll ( void ) - { - if ( ! _client ) - return; - - 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: - handle_save_file( name ); - - lash_send_event( _client, lash_event_new_with_type( LASH_Save_File ) ); - - break; - case LASH_Restore_File: - if ( ! handle_restore_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: - handle_quit(); - break; - default: -// WARNING( "unhandled LASH event" ); - break; - } - - lash_event_destroy( e ); - } - } - -#else - - bool - Client::init ( const char *jack_name, const char *long_name, int *argc, char ***argv ) - { - return true; - } - - bool - Client::enabled ( void ) - { - return false; - } - - void - Client::poll ( void ) - { - } - -#endif - -} diff --git a/nonlib/LASH/Client.H b/nonlib/LASH/Client.H deleted file mode 100644 index f259001..0000000 --- a/nonlib/LASH/Client.H +++ /dev/null @@ -1,52 +0,0 @@ - -/*******************************************************************************/ -/* 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 - -namespace LASH -{ - class Client - { - /* to avoid including the lash header here... */ - void *_void; - - protected: - - virtual bool handle_save_file ( const char *path ) = 0; - virtual bool handle_restore_file ( const char *path ) = 0; - virtual void handle_quit ( void ) = 0; - - public: - - Client ( ); - virtual ~Client ( ); - - bool init ( const char *jack_name, const char *full_name, int *argc, char ***argv ); - bool enabled ( void ); - void poll ( void ); - - void project_save ( void ); - void project_quit ( void ); - - /* TODO: project_add, project_remove, project_dir, project_name, percentage */ - - }; -}