[go: up one dir, main page]

Menu

[r1]: / src / lib / hd24utils.h  Maximize  Restore  History

Download this file

103 lines (94 with data), 3.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
#ifndef __hd24utils_h__
#define __hd24utils_h__
#ifndef WINDOWS
#define PATHSLASH "/"
# include <sys/dir.h>
# include <dirent.h>
#else
#define PATHSLASH "\\"
# include <dir.h>
# include <windows.h>
# include <winioctl.h>
# define FSHANDLE HANDLE
# define FSHANDLE_INVALID INVALID_HANDLE_VALUE
#endif
#if defined(LINUX) || defined(DARWIN)
# define FSHANDLE int
# define FSHANDLE_INVALID -1
#endif
#include <config.h>
#include <stdio.h>
#include <string>
#include <FL/FLTKstuff.H>
#include "convertlib.h"
#include "memutils.h"
#include <hd24fs.h>
#include <hd24sndfile.h>
using namespace std;
class hd24fs;
class hd24project;
class hd24song;
class hd24utils
{
friend class hd24fs;
friend class hd24project;
friend class hd24song;
private:
// static void savecatalog_showprojects(hd24fs* currenthd24,fstream & to_out);
// static void savecatalog_showsongs(hd24project* currentproj,fstream & to_out);
// locmode decides when locate points are displayed in the
// catalog
static bool gencatalog_showlocs(hd24song* currentsong,
string* strcatalog,
int locmode);
static bool gencatalog_showsongsize(hd24song* currentsong,
string* strcatalog,
int catalogoptions);
static void gencatalog_showsongs(hd24project* currentproj,
string* strcatalog,
int locmode);
static void gencatalog_showprojects(hd24fs* currenthd24,
string* strcatalog,
int locmode);
public:
static const int LOCMODE_NONE;
static const int LOCMODE_ALL;
static const int LOCMODE_NONZERO;
static const int LOCMODE_MASK;
static const int SIZEMODE_NONE;
static const int SIZEMODE_ACTUAL;
static const int SIZEMODE_ALLOCATED;
static const int SIZEMODE_BOTH;
static const int SIZEMODE_MASK;
// static int savecatalog(hd24fs* currenthd24,string* headerfilename,bool toprint);
// static int gencatalog(hd24fs* currenthd24,string* headerfilename,bool toprint);
static string* savecatalog( hd24fs* currenthd24,
string* filename,
int locmode);
static string* savecatalog( hd24fs* currenthd24,
string* filename);
static void findfile(const char* rawfilename, const char* searchpath, char* result);
static int gencatalog(hd24fs* currenthd24,string* strcatalog);
static int gencatalog(hd24fs* currenthd24,string* strcatalog,
int locmode);
static string* printcatalog(hd24fs* currenthd24);
static string* printcatalog(hd24fs* currenthd24,int locmode);
static int saveheader(hd24fs* currenthd24,string* headerfilename);
static int savedriveimage(hd24fs* currenthd24,string* imagefilename, char* message,int* cancel);
static int newdriveimage(string* imagefilename,__uint32 endsector,char* message,int* cancel);
static int savedrivesectors(hd24fs* currenthd24,string* imagefilename,unsigned long startsector,unsigned long endsector,char* message,int* cancel);
static void interlacetobuffer(unsigned char* sourcebuf,unsigned char* targetbuf, __uint32 totbytes,__uint32 bytespersam,__uint32 trackwithingroup,__uint32 trackspergroup);
static bool isdir(const char * name);
static bool isfile(const char * name);
static bool dirExists(const char * pszDirName);
static bool fileExists(const char * filename);
static string* getlastdir(string which);
static void dumpsector (const char* buffer);
static void setlastdir(string which,const char* newdir);
static string* getconfigvalue(string which,string strdefault);
static void setconfigvalue(string which,const char* newval);
static void recursivemkdir(string* dirname);
static bool guaranteefiledirexists(string* fname);
static bool wavefix(SoundFileWrapper* sndfile,const char* filetofix);
};
#endif