From a9bb336fc44ab4937978f5a0308e440ed632ea50 Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Mon, 8 Dec 2008 09:50:19 +0000 Subject: * first primitive implementation of MidiPatchManager * some cosmetic changes * added midi_patch_path() to libs/ardour/ardour/session_directory.h git-svn-id: svn://localhost/ardour2/branches/3.0@4299 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/session_directory.h | 7 +++++++ libs/ardour/directory_names.cc | 1 + libs/ardour/plugin_manager.cc | 2 +- libs/ardour/session_directory.cc | 6 ++++++ libs/midi++2/midi++/midnam_patch.h | 28 ++++++++++++++++++++++++---- libs/midi++2/midnam_patch.cc | 20 ++++++++++++++++++++ 6 files changed, 59 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/session_directory.h b/libs/ardour/ardour/session_directory.h index a4fb7d07c5..5c976374e3 100644 --- a/libs/ardour/ardour/session_directory.h +++ b/libs/ardour/ardour/session_directory.h @@ -61,6 +61,13 @@ public: * root_path()/interchange/session_name/midifiles */ const path midi_path () const; + + /** + * @return the absolute path to the directory in which + * the session stores MIDNAM patch files, ie + * root_path()/interchange/session_name/patchfiles + */ + const path midi_patch_path () const; /** * @return The absolute path to the directory in which all diff --git a/libs/ardour/directory_names.cc b/libs/ardour/directory_names.cc index 2b6dfcbb39..0480ddc8ba 100644 --- a/libs/ardour/directory_names.cc +++ b/libs/ardour/directory_names.cc @@ -7,6 +7,7 @@ namespace ARDOUR { const char* const old_sound_dir_name = X_("sounds"); const char* const sound_dir_name = X_("audiofiles"); const char* const midi_dir_name = X_("midifiles"); +const char* const midi_patch_dir_name = X_("patchfiles"); const char* const peak_dir_name = X_("peaks"); const char* const dead_sound_dir_name = X_("dead_sounds"); const char* const dead_midi_dir_name = X_("dead_midi"); diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index e7c2aecd2d..d4e995f0bf 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -478,7 +478,7 @@ PluginManager::vst_discover (string path) PluginInfoPtr info(new VSTPluginInfo); - /* what a goddam joke freeware VST is */ + /* what a joke freeware VST is */ if (!strcasecmp ("The Unnamed plugin", finfo->name)) { info->name = PBD::basename_nosuffix (path); diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc index d5f2ddc1ba..50e213a4c2 100644 --- a/libs/ardour/session_directory.cc +++ b/libs/ardour/session_directory.cc @@ -106,6 +106,12 @@ SessionDirectory::midi_path () const return sources_root() / midi_dir_name; } +const path +SessionDirectory::midi_patch_path () const +{ + return sources_root() / midi_patch_path(); +} + const path SessionDirectory::peak_path () const { diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h index 3abb6c6c54..2561d905eb 100644 --- a/libs/midi++2/midi++/midnam_patch.h +++ b/libs/midi++2/midi++/midnam_patch.h @@ -1,14 +1,34 @@ +/* + Copyright (C) 2008 Hans Baier + + 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; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + $Id$ +*/ + #ifndef MIDNAM_PATCH_H_ #define MIDNAM_PATCH_H_ -#include "pbd/stateful.h" -#include "midi++/event.h" -#include "pbd/xml++.h" - #include #include #include +#include "pbd/stateful.h" +#include "midi++/event.h" +#include "pbd/xml++.h" + namespace MIDI { diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc index 758667d909..56b36b5919 100644 --- a/libs/midi++2/midnam_patch.cc +++ b/libs/midi++2/midnam_patch.cc @@ -1,3 +1,23 @@ +/* + Copyright (C) 2008 Hans Baier + + 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; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + $Id$ +*/ + #include "midi++/midnam_patch.h" #include -- cgit v1.2.3