2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "recording.h"
23 Recording::Recording()
33 Recording::~Recording()
35 if (dirName) delete[] dirName;
36 if (progName) delete[] progName;
37 if (fileName) delete[] fileName;
38 index = -1; // just in case
41 int Recording::isInDir()
43 // if (strstr(name, "~")) return 1;
45 return (dirName != NULL);
48 char* Recording::getDirName()
50 /* char* sub = strstr(name, "~");
51 if (!sub) return NULL;
53 char* dirName = new char[sub - name + 1];
54 memcpy(dirName, name, sub - name);
55 dirName[sub - name] = '\0';
61 char* Recording::getProgName()
66 void Recording::setName(char* name)
68 char* sub = strstr(name, "~");
70 if (sub) // Its in a dir
72 dirName = new char[sub - name + 1];
73 memcpy(dirName, name, sub - name);
74 dirName[sub - name] = '\0';
77 int sublen = strlen(sub);
78 progName = new char[sublen + 1];
79 memcpy(progName, sub, strlen(sub));
80 progName[sublen] = '\0';
84 int len = strlen(name);
85 progName = new char[len + 1];
86 memcpy(progName, name, len);