aboutsummaryrefslogtreecommitdiff
path: root/src/lib/hd24utils.h
blob: b7a9fa7a2e393bf3664fa27835bea7b6644eef5e (plain)
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
#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>

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);
		static void gencatalog_showprojects(hd24fs* currenthd24,string* strcatalog);
		static void gencatalog_showsongs(hd24project* currentproj,string* strcatalog);

	public:
		// 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);
		static void findfile(const char* rawfilename, const char* searchpath, char* result);
		static int gencatalog(hd24fs* currenthd24,string* strcatalog);
		static string* printcatalog(hd24fs* currenthd24);
		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 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);	
};

#endif