summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-15 22:31:13 +0000
committerDavid Robillard <d@drobilla.net>2006-06-15 22:31:13 +0000
commite13e84677a9213fb54d641483a7fcf5ecf2feb0d (patch)
treee4462e8a8e14f15575ff5cbfbfa7cf42b14c00fc /libs/ardour/ardour
parentb5db1f624d347c8865c27fdae23bf4595be372d2 (diff)
Merged with trunk revision 610
git-svn-id: svn://localhost/ardour2/branches/midi@611 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/constsource.h60
-rw-r--r--libs/ardour/ardour/filesource.h201
-rw-r--r--libs/ardour/ardour/osc.h2
-rw-r--r--libs/ardour/ardour/seqsource.h55
-rw-r--r--libs/ardour/ardour/session.h3
-rw-r--r--libs/ardour/ardour/silentsource.h56
-rw-r--r--libs/ardour/ardour/types.h32
7 files changed, 5 insertions, 404 deletions
diff --git a/libs/ardour/ardour/constsource.h b/libs/ardour/ardour/constsource.h
deleted file mode 100644
index d000afb347..0000000000
--- a/libs/ardour/ardour/constsource.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis
-
- 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 __playlist_const_buffer_h__
-#define __playlist_const_buffer_h__
-
-#include <string>
-#include <cstdlib>
-
-#include "edl.h"
-
-namespace EDL {
-
-class ConstSource : public Source {
- public:
- ConstSource (const gchar *id) {
- _type = Source::Const;
- value = strtod (id, 0);
- strncpy (idstr, id, 15);
- idstr[15] = '\0';
- }
-
- const gchar * const id() { return idstr; }
-
- uint32_t length() { return ~0U; }
-
- uint32_t read (Source::Data *dst, uint32_t start, uint32_t cnt) {
- uint32_t n = cnt;
- while (n--) *dst++ = value;
- return cnt;
- }
- void peak (guint8 *max, guint8 *min, uint32_t start, uint32_t cnt) {
- *max = *min = (guint8) value;
- }
-
- private:
- Source::Data value;
- gchar idstr[16];
-};
-
-}; /* namespace EDL */
-
-#endif /* __playlist_const_buffer_h__ */
diff --git a/libs/ardour/ardour/filesource.h b/libs/ardour/ardour/filesource.h
deleted file mode 100644
index 28a01f0a78..0000000000
--- a/libs/ardour/ardour/filesource.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis
-
- 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 __playlist_file_buffer_h__
-#define __playlist_file_buffer_h__
-
-// darwin supports 64 by default and doesn't provide wrapper functions.
-#if defined (__APPLE__)
-typedef off_t off64_t;
-#define open64 open
-#define close64 close
-#define lseek64 lseek
-#define pread64 pread
-#define pwrite64 pwrite
-#endif
-
-#include <vector>
-#include <string>
-
-#include <ardour/source.h>
-
-struct tm;
-
-using std::string;
-
-namespace ARDOUR {
-
-class FileSource : public Source {
- public:
- FileSource (string path, jack_nframes_t rate, bool repair_first = false, SampleFormat samp_format=FormatFloat);
- FileSource (const XMLNode&, jack_nframes_t rate);
- ~FileSource ();
-
- int set_name (std::string str, bool destructive);
-
- void set_allow_remove_if_empty (bool yn);
-
- jack_nframes_t length() const { return _length; }
- jack_nframes_t read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
- jack_nframes_t write (Sample *src, jack_nframes_t cnt, char * workbuf);
- void mark_for_remove();
- string peak_path(string audio_path);
- string path() const { return _path; }
- float sample_rate () const;
-
- virtual int seek (jack_nframes_t frame) {return 0; }
- virtual jack_nframes_t last_capture_start_frame() const { return 0; }
- virtual void mark_capture_start (jack_nframes_t) {}
- virtual void mark_capture_end () {}
- virtual void clear_capture_marks() {}
-
- int update_header (jack_nframes_t when, struct tm&, time_t);
-
- int move_to_trash (const string trash_dir_name);
-
- static bool is_empty (string path);
- void mark_streaming_write_completed ();
-
- void mark_take (string);
- string take_id() const { return _take_id; }
-
- static void set_bwf_country_code (string x);
- static void set_bwf_organization_code (string x);
- static void set_bwf_serial_number (int);
-
- static void set_search_path (string);
-
- protected:
- int fd;
- string _path;
- bool remove_at_unref;
- bool is_bwf;
- off64_t data_offset;
- string _take_id;
- SampleFormat _sample_format;
- int _sample_size;
- bool allow_remove_if_empty;
-
- static char bwf_country_code[3];
- static char bwf_organization_code[4];
- static char bwf_serial_number[13];
-
- struct GenericChunk {
- char id[4];
- int32_t size;
- };
-
- struct WAVEChunk : public GenericChunk {
- char text[4]; /* wave pseudo-chunk id "WAVE" */
- };
-
- struct FMTChunk : public GenericChunk {
- int16_t formatTag; /* format tag; currently pcm */
- int16_t nChannels; /* number of channels */
- uint32_t nSamplesPerSec; /* sample rate in hz */
- int32_t nAvgBytesPerSec; /* average bytes per second */
- int16_t nBlockAlign; /* number of bytes per sample */
- int16_t nBitsPerSample; /* number of bits in a sample */
- };
-
- struct BroadcastChunk : public GenericChunk {
- char description[256];
- char originator[32];
- char originator_reference[32];
- char origination_date[10];
- char origination_time[8];
- int32_t time_reference_low;
- int32_t time_reference_high;
- int16_t version; /* 1.0 because we have umid and 190 bytes of "reserved" */
- char umid[64];
- char reserved[190];
- /* we don't treat coding history as part of the struct */
- };
-
- struct ChunkInfo {
- std::string name;
- uint32_t size;
- off64_t offset;
-
- ChunkInfo (string s, uint32_t sz, off64_t o)
- : name (s), size (sz), offset (o) {}
- };
-
- vector<ChunkInfo> chunk_info;
-
- struct {
- WAVEChunk wave;
- FMTChunk format;
- GenericChunk data;
- BroadcastChunk bext;
- vector<string> coding_history;
- bool bigendian;
- } header;
-
- int init (string, bool must_exist, jack_nframes_t);
- jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
-
- ssize_t file_write (Sample *src, jack_nframes_t framepos, jack_nframes_t cnt, char * workbuf) {
- switch (_sample_format) {
- case FormatInt24: return write_pcm_24(src, framepos, cnt, workbuf);
- default: return write_float(src, framepos, cnt, workbuf);
- };
- }
-
- ssize_t file_read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const {
- switch (_sample_format) {
- case FormatInt24: return read_pcm_24(dst, start, cnt, workbuf);
- default: return read_float(dst, start, cnt, workbuf);
- };
- }
-
- ssize_t write_float(Sample *src, jack_nframes_t framepos, jack_nframes_t cnt, char * workbuf);
- ssize_t read_float (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
- ssize_t write_pcm_24(Sample *src, jack_nframes_t framepos, jack_nframes_t cnt, char * workbuf);
- ssize_t read_pcm_24 (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
-
- int discover_chunks (bool silent);
- ChunkInfo* lookup_chunk (string name);
-
- int write_header ();
- int read_header (bool silent);
-
- int check_header (jack_nframes_t rate, bool silent);
- int fill_header (jack_nframes_t rate);
-
- int read_broadcast_data (ChunkInfo&);
- void compute_header_size ();
-
- static const int32_t wave_header_size = sizeof (WAVEChunk) + sizeof (FMTChunk) + sizeof (GenericChunk);
- static const int32_t bwf_header_size = wave_header_size + sizeof (BroadcastChunk);
-
- static string search_path;
-
- int repair (string, jack_nframes_t);
-
- void swap_endian (GenericChunk & chunk) const;
- void swap_endian (FMTChunk & chunk) const;
- void swap_endian (BroadcastChunk & chunk) const;
- void swap_endian (Sample *buf, jack_nframes_t cnt) const;
-};
-
-}
-
-#endif /* __playlist_file_buffer_h__ */
diff --git a/libs/ardour/ardour/osc.h b/libs/ardour/ardour/osc.h
index 69ec76eac6..0a34f44a41 100644
--- a/libs/ardour/ardour/osc.h
+++ b/libs/ardour/ardour/osc.h
@@ -32,7 +32,7 @@
#include <ardour/types.h>
-#include "basic_ui.h"
+#include <control_protocol/basic_ui.h>
namespace ARDOUR {
class Session;
diff --git a/libs/ardour/ardour/seqsource.h b/libs/ardour/ardour/seqsource.h
deleted file mode 100644
index 7e38d27915..0000000000
--- a/libs/ardour/ardour/seqsource.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis
-
- 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 __playlist_seqsource_h__
-#define __playlist_seqsource_h__
-
-#include <string>
-
-#include "edl.h"
-
-namespace EDL {
-
-class PlaylistSource : public Source {
- public:
- PlaylistSource (Playlist&);
- ~PlaylistSource ();
-
- const gchar * const id() { return playlist.name().c_str(); }
- uint32_t length() { return playlist.length(); }
- uint32_t read (Source::Data *dst, uint32_t start, uint32_t cnt) {
- return playlist.read (dst, start, cnt, false);
- }
- uint32_t write (Source::Data *src, uint32_t where, uint32_t cnt) {
- return playlist.write (src, where, cnt);
- }
-
-// int read_peaks (peak_data_t *, uint32_t npeaks, uint32_t start, uint32_t cnt);
-// int build_peak (uint32_t first_frame, uint32_t cnt);
-
- protected:
-
- private:
- Playlist& playlist;
-};
-
-}; /* namespace EDL */
-
-#endif /* __playlist_seqsource_h__ */
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 0554d13e68..a193536d74 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -592,7 +592,6 @@ class Session : public sigc::trackable, public Stateful
int set_smpte_type (float fps, bool drop_frames);
void bbt_time (jack_nframes_t when, BBT_Time&);
-
void smpte_to_sample( SMPTE::Time& smpte, jack_nframes_t& sample, bool use_offset, bool use_subframes ) const;
void sample_to_smpte( jack_nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes ) const;
void smpte_time (SMPTE::Time &);
@@ -1352,7 +1351,7 @@ class Session : public sigc::trackable, public Stateful
jack_nframes_t last_smpte_when;
SMPTE::Time last_smpte;
- bool _send_smpte_update; ///< Send a full MTC timecode this cycle
+ bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
int send_full_time_code(jack_nframes_t nframes);
int send_midi_time_code_for_cycle(jack_nframes_t nframes);
diff --git a/libs/ardour/ardour/silentsource.h b/libs/ardour/ardour/silentsource.h
deleted file mode 100644
index 0079e5f103..0000000000
--- a/libs/ardour/ardour/silentsource.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis
-
- 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 __playlist_const_buffer_h__
-#define __playlist_const_buffer_h__
-
-#include <string>
-#include <cstdlib>
-
-#include "source.h"
-
-namespace ARDOUR {
-
-class SilentSource : public Source {
- public:
- SilentSource () {
- _name = "Silent Source";
- }
-
- static bool is_silent_source (const string& name) {
- return name == "Silent Source";
- }
-
- jack_nframes_t length() { return ~0U; }
-
- jack_nframes_t read (Source::Data *dst, jack_nframes_t start, jack_nframes_t cnt) {
- jack_nframes_t n = cnt;
- while (n--) *dst++ = 0;
- return cnt;
- }
-
- void peak (guint8 *max, guint8 *min, jack_nframes_t start, jack_nframes_t cnt) {
- *max = *min = 0;
- }
-};
-
-}
-
-#endif /* __playlist_const_buffer_h__ */
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index cdf71b8cc6..a0a209b569 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -29,6 +29,7 @@
#include <inttypes.h>
#include <jack/types.h>
+#include <control_protocol/smpte.h>
#include <map>
#if __GNUC__ < 3
@@ -98,34 +99,7 @@ namespace ARDOUR {
Normal,
Destructive
};
-
- enum smpte_wrap_t {
- smpte_wrap_none = 0,
- smpte_wrap_frames,
- smpte_wrap_seconds,
- smpte_wrap_minutes,
- smpte_wrap_hours
- };
-
- struct SMPTE_Time {
- bool negative;
- uint32_t hours;
- uint32_t minutes;
- uint32_t seconds;
- uint32_t frames;
- uint32_t subframes; // mostly not used
-
- SMPTE_Time() {
- negative = false;
- hours = 0;
- minutes = 0;
- seconds = 0;
- frames = 0;
- subframes = 0;
- }
-
- };
-
+
struct BBT_Time {
uint32_t bars;
uint32_t beats;
@@ -164,7 +138,7 @@ namespace ARDOUR {
Type type;
- SMPTE_Time smpte;
+ SMPTE::Time smpte;
BBT_Time bbt;
union {