Mixer: Changes to support project saving/loading.
[nondaw.git] / Timeline / Project.H
blobda14b67a6e2076bdfaf324cc572151d0a2679017
2 /*******************************************************************************/
3 /* Copyright (C) 2008 Jonathan Moore Liles                                     */
4 /*                                                                             */
5 /* This program is free software; you can redistribute it and/or modify it     */
6 /* under the terms of the GNU General Public License as published by the       */
7 /* Free Software Foundation; either version 2 of the License, or (at your      */
8 /* option) any later version.                                                  */
9 /*                                                                             */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       */
12 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   */
13 /* more details.                                                               */
14 /*                                                                             */
15 /* You should have received a copy of the GNU General Public License along     */
16 /* with This program; see the file COPYING.  If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18 /*******************************************************************************/
20 const char template_dir[] = "share/non-daw/templates";
21 const char user_template_dir[] = "~/.non-daw/templates";
23 #include "types.h"
25 class Project
28     static int _lockfd;
29     static bool _is_open;
30     static char _name[256];
31     static char _path[512];
32     static char _created_on[40];
34     static bool write_info ( void );
35     static bool read_info ( int *version, nframes_t *sample_rate, char **creation_date );
36     static void set_name ( const char *name );
37     static const char *_errstr[];
39 public:
41     enum
42     {
43         E_INVALID = -1,
44         E_LOCKED = -2,
45         E_PERM = -3,
46         E_SAMPLERATE = -4,
47         E_VERSION = -5
48     };
50     static const char *errstr ( int n ) { return _errstr[ ( 0 - n ) - 1 ]; }
52     static const char *name ( void ) { return Project::_name; }
53     static void compact ( void );
54     static bool close ( void );
55     static bool save ( void );
56     static bool validate ( const char *name );
57     static int open ( const char *name );
58     static bool open ( void ) { return _is_open; }
59     static bool create ( const char *name, const char *template_name );
61     static const char *created_on ( void ) { return _created_on; }