2005-10-27 15:46:27 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2005 Paul Davis
|
|
|
|
Written by Taybin Rutkin
|
|
|
|
|
|
|
|
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>
|
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 <gtkmm/liststore.h>
|
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
|
|
|
|
#include <ardour/session.h>
|
2006-03-10 12:09:59 -05:00
|
|
|
#include <ardour/externalsource.h>
|
2005-10-12 16:06:20 -04:00
|
|
|
|
2005-12-02 17:12:56 -05:00
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
2005-12-07 17:57:47 -05:00
|
|
|
class SoundFileBox : public Gtk::VBox
|
|
|
|
{
|
|
|
|
public:
|
2006-01-04 00:53:51 -05:00
|
|
|
SoundFileBox ();
|
2005-12-07 17:57:47 -05:00
|
|
|
virtual ~SoundFileBox () {};
|
|
|
|
|
2006-01-04 00:53:51 -05:00
|
|
|
void set_session (ARDOUR::Session* s);
|
2006-01-05 00:15:29 -05:00
|
|
|
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-01-04 00:53:51 -05:00
|
|
|
|
2005-12-07 17:57:47 -05:00
|
|
|
struct LabelModelColumns : public Gtk::TreeModel::ColumnRecord
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Gtk::TreeModelColumn<std::string> field;
|
|
|
|
Gtk::TreeModelColumn<std::string> data;
|
|
|
|
|
|
|
|
LabelModelColumns() { add(field); add(data); }
|
|
|
|
};
|
|
|
|
|
|
|
|
LabelModelColumns label_columns;
|
|
|
|
|
2006-03-10 12:09:59 -05:00
|
|
|
ARDOUR::SoundFileInfo sf_info;
|
2005-12-07 17:57:47 -05:00
|
|
|
|
|
|
|
pid_t current_pid;
|
|
|
|
|
|
|
|
Gtk::Label length;
|
|
|
|
Gtk::Label format;
|
|
|
|
Gtk::Label channels;
|
|
|
|
Gtk::Label samplerate;
|
|
|
|
|
|
|
|
Gtk::TreeView field_view;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> fields;
|
|
|
|
std::string selected_field;
|
|
|
|
|
|
|
|
Gtk::Frame border_frame;
|
|
|
|
|
|
|
|
Gtk::VBox main_box;
|
|
|
|
Gtk::VBox path_box;
|
|
|
|
Gtk::HBox top_box;
|
|
|
|
Gtk::HBox bottom_box;
|
|
|
|
|
|
|
|
Gtk::Button play_btn;
|
|
|
|
Gtk::Button stop_btn;
|
|
|
|
Gtk::Button add_field_btn;
|
|
|
|
Gtk::Button remove_field_btn;
|
|
|
|
|
|
|
|
void setup_fields ();
|
|
|
|
|
|
|
|
void play_btn_clicked ();
|
|
|
|
void stop_btn_clicked ();
|
|
|
|
void add_field_clicked ();
|
|
|
|
void remove_field_clicked ();
|
2006-01-18 16:05:59 -05:00
|
|
|
void delete_row (const Gtk::TreeModel::iterator& iter);
|
2005-12-07 17:57:47 -05:00
|
|
|
|
|
|
|
void field_selected ();
|
|
|
|
void audition_status_changed (bool state);
|
|
|
|
};
|
|
|
|
|
2005-12-02 17:12:56 -05:00
|
|
|
class SoundFileBrowser : public ArdourDialog
|
2005-10-12 17:59:45 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SoundFileBrowser (std::string title);
|
2005-12-07 17:57:47 -05:00
|
|
|
virtual ~SoundFileBrowser () {};
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2006-01-04 00:53:51 -05:00
|
|
|
virtual void set_session (ARDOUR::Session*);
|
2005-10-12 17:59:45 -04:00
|
|
|
protected:
|
2005-10-12 23:48:57 -04:00
|
|
|
Gtk::FileChooserWidget chooser;
|
2005-12-07 17:57:47 -05:00
|
|
|
SoundFileBox preview;
|
|
|
|
|
|
|
|
void update_preview ();
|
2005-10-12 17:59:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class SoundFileChooser : public SoundFileBrowser
|
2005-10-12 16:06:20 -04:00
|
|
|
{
|
|
|
|
public:
|
2005-10-12 17:59:45 -04:00
|
|
|
SoundFileChooser (std::string title);
|
2005-10-12 23:48:57 -04:00
|
|
|
virtual ~SoundFileChooser () {};
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
std::string get_filename () {return chooser.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:
|
|
|
|
SoundFileOmega (std::string title);
|
2005-10-12 23:48:57 -04:00
|
|
|
virtual ~SoundFileOmega () {};
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
sigc::signal<void, std::vector<std::string>, bool> Embedded;
|
|
|
|
sigc::signal<void, std::vector<std::string>, bool> Imported;
|
2005-10-12 17:59:45 -04:00
|
|
|
|
|
|
|
protected:
|
2005-10-12 23:48:57 -04:00
|
|
|
Gtk::Button embed_btn;
|
|
|
|
Gtk::Button import_btn;
|
|
|
|
Gtk::CheckButton split_check;
|
|
|
|
|
|
|
|
void embed_clicked ();
|
|
|
|
void import_clicked ();
|
|
|
|
};
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2005-10-12 16:06:20 -04:00
|
|
|
#endif // __ardour_sfdb_ui_h__
|