2005-10-27 15:46:27 -04:00
|
|
|
/*
|
2006-12-01 01:01:30 -05:00
|
|
|
Copyright (C) 2005-2006 Paul Davis
|
2005-10-27 15:46:27 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-10-12 16:06:20 -04:00
|
|
|
#ifndef __ardour_sfdb_ui_h__
|
|
|
|
#define __ardour_sfdb_ui_h__
|
|
|
|
|
|
|
|
#include <string>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <vector>
|
2005-10-12 16:06:20 -04:00
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
#include <sigc++/signal.h>
|
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/button.h>
|
2005-10-12 23:48:57 -04:00
|
|
|
#include <gtkmm/checkbutton.h>
|
2007-01-05 14:53:38 -05:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/dialog.h>
|
2005-12-07 17:57:47 -05:00
|
|
|
#include <gtkmm/entry.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/filechooserwidget.h>
|
2005-12-07 17:57:47 -05:00
|
|
|
#include <gtkmm/frame.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
|
|
|
|
#include <ardour/session.h>
|
2006-06-14 17:17:32 -04:00
|
|
|
#include <ardour/audiofilesource.h>
|
2005-10-12 16:06:20 -04:00
|
|
|
|
2005-12-02 17:12:56 -05:00
|
|
|
#include "ardour_dialog.h"
|
2006-03-22 12:03:00 -05:00
|
|
|
#include "editing.h"
|
2005-12-02 17:12:56 -05:00
|
|
|
|
2005-12-07 17:57:47 -05:00
|
|
|
class SoundFileBox : public Gtk::VBox
|
|
|
|
{
|
|
|
|
public:
|
2006-12-01 01:01:30 -05:00
|
|
|
SoundFileBox ();
|
|
|
|
virtual ~SoundFileBox () {};
|
|
|
|
|
|
|
|
void set_session (ARDOUR::Session* s);
|
|
|
|
bool setup_labels (std::string filename);
|
2005-12-07 17:57:47 -05:00
|
|
|
|
|
|
|
protected:
|
2006-01-04 00:53:51 -05:00
|
|
|
ARDOUR::Session* _session;
|
2006-01-11 16:27:59 -05:00
|
|
|
std::string path;
|
2006-12-01 01:01:30 -05:00
|
|
|
|
|
|
|
ARDOUR::SoundFileInfo sf_info;
|
|
|
|
|
|
|
|
pid_t current_pid;
|
|
|
|
|
|
|
|
Gtk::Label length;
|
|
|
|
Gtk::Label format;
|
|
|
|
Gtk::Label channels;
|
|
|
|
Gtk::Label samplerate;
|
|
|
|
Gtk::Label timecode;
|
|
|
|
|
|
|
|
Gtk::Frame border_frame;
|
|
|
|
|
|
|
|
Gtk::Entry tags_entry;
|
|
|
|
|
|
|
|
Gtk::VBox main_box;
|
|
|
|
Gtk::VBox path_box;
|
|
|
|
Gtk::HBox bottom_box;
|
|
|
|
|
|
|
|
Gtk::Button play_btn;
|
|
|
|
Gtk::Button stop_btn;
|
|
|
|
Gtk::Button apply_btn;
|
|
|
|
|
|
|
|
bool tags_entry_left (GdkEventFocus* event);
|
|
|
|
void play_btn_clicked ();
|
|
|
|
void stop_btn_clicked ();
|
|
|
|
void apply_btn_clicked ();
|
|
|
|
|
|
|
|
void audition_status_changed (bool state);
|
2005-12-07 17:57:47 -05:00
|
|
|
};
|
|
|
|
|
2005-12-02 17:12:56 -05:00
|
|
|
class SoundFileBrowser : public ArdourDialog
|
2005-10-12 17:59:45 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-12-01 01:01:30 -05:00
|
|
|
SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0);
|
2007-02-01 14:53:58 -05:00
|
|
|
virtual ~SoundFileBrowser ();
|
2006-12-01 01:01:30 -05:00
|
|
|
|
|
|
|
virtual void set_session (ARDOUR::Session*);
|
2006-03-22 12:03:00 -05:00
|
|
|
|
2005-10-12 17:59:45 -04:00
|
|
|
protected:
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::FileChooserWidget chooser;
|
2007-05-15 22:21:41 -04:00
|
|
|
Gtk::FileFilter custom_filter;
|
|
|
|
Gtk::FileFilter matchall_filter;
|
2006-12-01 01:01:30 -05:00
|
|
|
SoundFileBox preview;
|
2007-02-01 14:53:58 -05:00
|
|
|
|
|
|
|
static Glib::ustring persistent_folder;
|
|
|
|
|
2007-01-04 23:24:23 -05:00
|
|
|
class FoundTagColumns : public Gtk::TreeModel::ColumnRecord
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Gtk::TreeModelColumn<string> pathname;
|
|
|
|
|
|
|
|
FoundTagColumns() { add(pathname); }
|
|
|
|
};
|
|
|
|
|
|
|
|
FoundTagColumns found_list_columns;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> found_list;
|
|
|
|
Gtk::TreeView found_list_view;
|
|
|
|
Gtk::Entry found_entry;
|
|
|
|
Gtk::Button found_search_btn;
|
2007-02-01 14:53:58 -05:00
|
|
|
|
2007-01-04 23:24:23 -05:00
|
|
|
Gtk::Notebook notebook;
|
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
void update_preview ();
|
2007-01-04 23:24:23 -05:00
|
|
|
void found_list_view_selected ();
|
|
|
|
void found_search_clicked ();
|
|
|
|
|
|
|
|
bool on_custom (const Gtk::FileFilter::Info& filter_info);
|
2005-10-12 17:59:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class SoundFileChooser : public SoundFileBrowser
|
2005-10-12 16:06:20 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-12-01 01:01:30 -05:00
|
|
|
SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
|
|
|
|
virtual ~SoundFileChooser () {};
|
|
|
|
|
2007-01-05 14:53:38 -05:00
|
|
|
std::string get_filename ();
|
2005-10-12 16:06:20 -04:00
|
|
|
};
|
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
class SoundFileOmega : public SoundFileBrowser
|
2005-10-12 17:59:45 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-12-01 01:01:30 -05:00
|
|
|
SoundFileOmega (std::string title, ARDOUR::Session* _s);
|
|
|
|
virtual ~SoundFileOmega () {};
|
|
|
|
|
|
|
|
/* these are returned by the Dialog::run() method. note
|
|
|
|
that builtin GTK responses are all negative, leaving
|
|
|
|
positive values for application-defined responses.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const static int ResponseImport = 1;
|
|
|
|
const static int ResponseEmbed = 2;
|
|
|
|
|
|
|
|
std::vector<Glib::ustring> get_paths ();
|
|
|
|
bool get_split ();
|
|
|
|
|
|
|
|
void set_mode (Editing::ImportMode);
|
|
|
|
Editing::ImportMode get_mode ();
|
2005-10-12 17:59:45 -04:00
|
|
|
|
|
|
|
protected:
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::CheckButton split_check;
|
|
|
|
Gtk::ComboBoxText mode_combo;
|
|
|
|
|
|
|
|
void mode_changed ();
|
|
|
|
|
|
|
|
static std::vector<std::string> mode_strings;
|
2005-10-12 23:48:57 -04:00
|
|
|
};
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2005-10-12 16:06:20 -04:00
|
|
|
#endif // __ardour_sfdb_ui_h__
|