File: ConfigFunctions.cpp

package info (click to toggle)
psemu-drive-cdrmooby 2.8%2Bo-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 356 kB
  • ctags: 899
  • sloc: cpp: 3,286; ansic: 2,069; makefile: 46
file content (134 lines) | stat: -rw-r--r-- 4,237 bytes parent folder | download | duplicates (2)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/************************************************************************

Copyright mooby 2002

CDRMooby2 ConfigFunctions.cpp
http://mooby.psxfanatics.com

  This file is protected by the GNU GPL which should be included with
  the source code distribution.

************************************************************************/

#pragma warning(disable:4786)

#include "defines.h"

#include "externs.h"

#include <FL/Fl.H>
#include <FL/fl_ask.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Check_Button.H>

#include <iostream>
#include "Utils.hpp"
#include "Preferences.hpp"
#include "ConfigFunctions.hpp"

extern Preferences prefs;

void ConfigWindow::makeWindow()
{
  { 
    Fl_Window* o = new Fl_Window(500, 500, "CDRMooby2 Config");
    w = o;
    { Fl_Check_Button* o = new Fl_Check_Button(20,20,220,40, "Repeat all CDDA tracks");
      o->value(prefs.prefsMap[repeatString] == repeatAllString);
      o->callback((Fl_Callback*)repeatAllCDDA, this);
      repeatAllButton = o;
    }
    { Fl_Check_Button* o = new Fl_Check_Button(20,60,220,40, "Repeat one CDDA track");
      o->value(prefs.prefsMap[repeatString] == repeatOneString);
      o->callback((Fl_Callback*)repeatOneCDDA, this);
      repeatOneButton = o;
    }
    { Fl_Check_Button* o = new Fl_Check_Button(20,100,220,40, "Play one CDDA track and stop");
      o->value(prefs.prefsMap[repeatString] == playOneString);
      o->callback((Fl_Callback*)playOneCDDA, this);
      playOneButton = o;
    }
    { Fl_Value_Slider* o = new Fl_Value_Slider(20, 140, 210, 25, "CDDA Volume");
      o->type(1);
      o->value(atof(prefs.prefsMap[volumeString].c_str()));
      o->callback((Fl_Callback*)CDDAVolume);
    }
    { Fl_Button* o = new Fl_Button(20, 230, 95, 25, "Compress");
      o->callback((Fl_Callback*)bzCompress);
    }
    { Fl_Button* o = new Fl_Button(130, 230, 95, 25, "Decompress");
      o->callback((Fl_Callback*)bzDecompress);
    }
    { Fl_Button* o = new Fl_Button(20, 305, 95, 25, "Compress");
      o->callback((Fl_Callback*)zCompress);
    }
    { Fl_Button* o = new Fl_Button(130, 305, 95, 25, "Decompress");
      o->callback((Fl_Callback*)zDecompress);
    }
    new Fl_Box(5, 200, 250, 25, "bz.index compression");
    new Fl_Box(5, 280, 250, 25, ".Z.table compression");
    { 
      Fl_Box* o;
      if (prefs.prefsMap[autorunString] == std::string(""))
         o = new Fl_Box(0, 350, 250, 25, "No autorun image selected");   
      else
         o = new Fl_Box(0, 350, 250, 25, prefs.prefsMap[autorunString].c_str());
      autorunBox = o;
    }
    {
      Fl_Button* o = new Fl_Button(20, 380, 200, 25, "Choose an autorun image");
      o->callback((Fl_Callback*)chooseAutorunImage, this);
    }
    {
      Fl_Button* o = new Fl_Button(20, 415, 200, 25, "Clear the autorun image");
      o->callback((Fl_Callback*)clearAutorunImage, this);
    }
    { Fl_Return_Button* o = new Fl_Return_Button(165, 465, 80, 25, "OK");
      o->callback((Fl_Callback*)configOK, this);
    }
    { Fl_Check_Button* o = new Fl_Check_Button(270,50,220,40, "Enable subchannel data");
      o->value(prefs.prefsMap[subEnableString] != std::string());
      o->callback((Fl_Callback*)subEnable);
    }
    { Fl_Check_Button* o = new Fl_Check_Button(270,100,220,40, "Use new caching (may be slower)");
      o->value(prefs.prefsMap[cachingModeString] == newCachingString);
      o->callback((Fl_Callback*)newCaching);
    }
    { Fl_Value_Slider* o = new Fl_Value_Slider(270, 140, 210, 25, "Cache size (1 frame = 2353 bytes)");
      o->type(1);
      o->range(1, 50000);
      o->step(1);
      o->value(atoi(prefs.prefsMap[cacheSizeString].c_str()));
      o->callback((Fl_Callback*)cacheSize);
    }
    o->set_modal();
    o->end();
  }
}



/** configure plugin external functions **/

long CALLBACK CDRconfigure(void)
{
   RunConfig();
   return 0;
}


int    CD_Configure(UINT32 *par)
{
	RunConfig();
   return 0;
}

void CALLBACK CDVDconfigure()
{
   CDRconfigure();
}