Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

v1.6wip. multiple changes, check modizer_changes.txt

  • Loading branch information...
commit 9fd7763a2aee233e08888422b364e87547ab3950 1 parent 7b58e43
yoyofr authored February 15, 2012
7  dumb/src/src/it/itread.c
@@ -1330,9 +1330,12 @@ DUH *dumb_read_it_quick(DUMBFILE *f)
1330 1330
 		return NULL;
1331 1331
 
1332 1332
 	{
1333  
-		const char *tag[1][2];
  1333
+		const char *tag[2][2];
1334 1334
 		tag[0][0] = "TITLE";
1335 1335
 		tag[0][1] = ((DUMB_IT_SIGDATA *)sigdata)->name;
1336  
-		return make_duh(-1, 1, (const char *const (*)[2])tag, 1, &descptr, &sigdata);
  1336
+        tag[1][0] = "FORMAT";
  1337
+		tag[1][1] = "IT";
  1338
+		
  1339
+		return make_duh(-1, 2, (const char *const (*)[2])tag, 1, &descptr, &sigdata);                
1337 1340
 	}
1338 1341
 }
2  libtim/interface/dumb_c.c
@@ -67,7 +67,7 @@ ControlMode ctl=
67 67
 {
68 68
     "dumb interface", 'd',
69 69
     "dumb",
70  
-    1,0,0,
  70
+    VERB_VERBOSE,0,0,
71 71
     0,
72 72
     ctl_open,
73 73
     ctl_close,
5  libtim/timidity/common.c
@@ -87,6 +87,7 @@ MBlockList tmpbuffer;
87 87
 char *output_text_code = NULL;
88 88
 int open_file_noise_mode = OF_NORMAL;
89 89
 
  90
+#undef DEFAULT_PATH
90 91
 #ifdef DEFAULT_PATH
91 92
     /* The paths in this list will be tried whenever we're reading a file */
92 93
     static PathList defaultpathlist={DEFAULT_PATH,0};
@@ -794,8 +795,8 @@ void add_to_pathlist(char *s)
794 795
 {
795 796
     PathList *cur, *prev, *plp;
796 797
     //MODIZER
797  
-    pathlist->path=s;
798  
-    return;
  798
+    //pathlist->path=s;
  799
+    //return;
799 800
 
800 801
     /* Check duplicated path in the pathlist. */
801 802
     plp = prev = NULL;
2  libtim/timidity/sndfont.c
@@ -262,7 +262,7 @@ void add_soundfont(char *sf_file,
262 262
 		   int amp)
263 263
 {
264 264
     SFInsts *sf;
265  
-
  265
+    
266 266
     if((sf = find_soundfont(sf_file)) == NULL)
267 267
     {
268 268
         sf = new_soundfont(sf_file);
23  libtim/timidity/timidity.c
@@ -2524,15 +2524,15 @@ static int read_user_config_file(void)
2524 2524
     {
2525 2525
 	ctl->cmsg(CMSG_INFO, VERB_NOISY,
2526 2526
 		  "Warning: HOME environment is not defined.");
2527  
-	return 0;
  2527
+	return -1;
2528 2528
     }
2529  
-    sprintf(path, "%s" PATH_STRING ".timidity.cfg", home);
  2529
+    sprintf(path, "%s" PATH_STRING "Documents/timidity.cfg", home);
2530 2530
 
2531 2531
     if((opencheck = open(path, 0)) < 0)
2532 2532
     {
2533 2533
 	ctl->cmsg(CMSG_INFO, VERB_NOISY, "%s: %s",
2534 2534
 		  path, strerror(errno));
2535  
-	return 0;
  2535
+	return -2;
2536 2536
     }
2537 2537
 
2538 2538
     close(opencheck);
@@ -5298,18 +5298,23 @@ MAIN_INTERFACE void timidity_start_initialize(void)
5298 5298
 MAIN_INTERFACE int timidity_pre_load_configuration(void)
5299 5299
 {
5300 5300
     /* UNIX */
5301  
-    if(!read_config_file(CONFIG_FILE, 0))
5302  
-		got_a_configuration = 1;
5303  
-
5304 5301
     /* Try read configuration file which is in the
5305 5302
      * $HOME (or %HOME% for DOS) directory.
5306 5303
      * Please setup each user preference in $HOME/.timidity.cfg
5307 5304
      * (or %HOME%/timidity.cfg for DOS)
5308 5305
      */
5309 5306
 
5310  
-    if(read_user_config_file())
5311  
-	ctl->cmsg(CMSG_INFO, VERB_NOISY,
  5307
+    if(read_user_config_file()) {
  5308
+        ctl->cmsg(CMSG_INFO, VERB_NOISY,
5312 5309
 		  "Warning: Can't read ~/.timidity.cfg correctly");
  5310
+    } else {
  5311
+        got_a_configuration = 1;
  5312
+    }
  5313
+    
  5314
+    if (got_a_configuration==0) {
  5315
+    if(!read_config_file(CONFIG_FILE, 0))
  5316
+     got_a_configuration = 1;
  5317
+    }
5313 5318
     return 0;
5314 5319
 }
5315 5320
 
@@ -5666,7 +5671,7 @@ extern PlayMode ios_play_mode;
5666 5671
 extern volatile int mSlowDevice;
5667 5672
     
5668 5673
 int tim_init(char *path) {    
5669  
-    
  5674
+//    printf("initpath:%s\n",path);
5670 5675
     add_to_pathlist(path);
5671 5676
     
5672 5677
     return 0;
5  modizer/Classes/DetailViewControllerIphone.h
@@ -126,7 +126,7 @@ class CGLString;
126 126
 	
127 127
 	IBOutlet UISegmentedControl *sc_checkBeforeRedownload,*sc_AfterDownload,*sc_EnqueueMode,*sc_DefaultAction,*segcont_randFx,*sc_allowPopup,*sc_titleFilename;
128 128
 	IBOutlet UISegmentedControl *segcont_spectrum,*segcont_shownote,*segcont_mpSampling,*segcont_forceMono,*sc_bgPlay,*sc_showDebug;
129  
-	IBOutlet UISegmentedControl *segcont_mpMB,*segcont_mpReverb,*segcont_mpSUR,*segcont_fx1,*segcont_fx2,*segcont_fx3,*segcont_fx4,*segcont_fx5,*segcont_FxBeat,*sc_cflow,*sc_AOSDKDSFDSP,*sc_AOSDKDSFEmuRatio,*sc_AOSDKSSFDSP,*sc_AOSDKSSFEmuRatio;
  129
+	IBOutlet UISegmentedControl *segcont_mpMB,*segcont_mpReverb,*segcont_mpSUR,*segcont_fx1,*segcont_fx2,*segcont_fx3,*segcont_fx4,*segcont_fx5,*segcont_FxBeat,*sc_cflow,*sc_AOSDKDSFDSP,*sc_AOSDKDSFEmuRatio,*sc_AOSDKSSFDSP,*sc_AOSDKSSFEmuRatio,*sc_AOSDKDSF22KHZ;
130 130
 	IBOutlet UISegmentedControl *segcont_oscillo;
131 131
     //,*segcont_resumeLaunch
132 132
 	IBOutlet UISegmentedControl *sc_UADE_Led,*sc_UADE_Norm,*sc_UADE_PostFX,*sc_UADE_Pan,*sc_UADE_Head,*sc_UADE_Gain,*sc_FXDetail,*sc_Panning;
@@ -330,7 +330,7 @@ class CGLString;
330 330
 @property (nonatomic, retain) IBOutlet UISlider *surDepSld,*surDelSld,*revDepSld,*revDelSld,*bassAmoSld,*bassRanSld,*mastVolSld,*mpPanningSld,*sldFxAlpha,*sldDUMBMastVol,*sldPanning;
331 331
 @property (nonatomic, retain) IBOutlet UITextView *textMessage;
332 332
 
333  
-@property (nonatomic, retain) IBOutlet UISegmentedControl *segcont_fx1,*segcont_fx2,*segcont_fx3,*segcont_fx4,*segcont_fx5,*segcont_randFx,*segcont_FxBeat,*sc_cflow,*sc_AOSDKDSFDSP,*sc_AOSDKDSFEmuRatio,*sc_AOSDKSSFDSP,*sc_AOSDKSSFEmuRatio;
  333
+@property (nonatomic, retain) IBOutlet UISegmentedControl *segcont_fx1,*segcont_fx2,*segcont_fx3,*segcont_fx4,*segcont_fx5,*segcont_randFx,*segcont_FxBeat,*sc_cflow,*sc_AOSDKDSFDSP,*sc_AOSDKDSFEmuRatio,*sc_AOSDKSSFDSP,*sc_AOSDKSSFEmuRatio,*sc_AOSDKDSF22KHZ;
334 334
 @property (nonatomic, retain) IBOutlet UISegmentedControl *segcont_spectrum,*segcont_shownote,*segcont_forceMono,*sc_checkBeforeRedownload,*sc_AfterDownload,*sc_EnqueueMode;
335 335
 @property (nonatomic, retain) IBOutlet UISegmentedControl *segcont_mpSampling,*segcont_mpMB,*segcont_mpReverb,*segcont_mpSUR;
336 336
 @property (nonatomic, retain) IBOutlet UISegmentedControl *segcont_oscillo,*sc_DefaultAction,*sc_bgPlay,*sc_showDebug;
@@ -354,6 +354,7 @@ class CGLString;
354 354
 -(IBAction) optTIM_Polyphony;
355 355
 -(IBAction) optFX_Alpha;
356 356
 
  357
+-(IBAction) optAOSDK_DSF22KHZ;
357 358
 -(IBAction) optAOSDK_DSFDSP;
358 359
 -(IBAction) optAOSDK_DSFEmuRatio;
359 360
 -(IBAction) optAOSDK_SSFDSP;
16  modizer/Classes/DetailViewControllerIphone.mm
@@ -141,7 +141,7 @@ @implementation DetailViewControllerIphone
141 141
 @synthesize segcont_oscillo,segcont_forceMono,sc_checkBeforeRedownload,sc_bgPlay,sc_StatsUpload,sc_SpokenTitle,sc_showDebug;
142 142
 //segcont_resumeLaunch
143 143
 @synthesize segcont_spectrum,segcont_shownote,segcont_mpSampling;
144  
-@synthesize segcont_mpMB,segcont_mpReverb,segcont_mpSUR,segcont_fx1,segcont_fx2,segcont_fx3,segcont_fx4,segcont_fx5,segcont_FxBeat,sc_FXDetail,sc_cflow,sc_AOSDKDSFDSP,sc_AOSDKDSFEmuRatio,sc_AOSDKSSFDSP,sc_AOSDKSSFEmuRatio;
  144
+@synthesize segcont_mpMB,segcont_mpReverb,segcont_mpSUR,segcont_fx1,segcont_fx2,segcont_fx3,segcont_fx4,segcont_fx5,segcont_FxBeat,sc_FXDetail,sc_cflow,sc_AOSDKDSFDSP,sc_AOSDKDSFEmuRatio,sc_AOSDKSSFDSP,sc_AOSDKSSFEmuRatio,sc_AOSDKDSF22KHZ;
145 145
 @synthesize sc_SEXYPSF_Reverb,sc_SEXYPSF_Interpol;
146 146
 @synthesize sc_AOSDK_Reverb,sc_AOSDK_Interpol;
147 147
 @synthesize sc_ADPLUG_opltype;
@@ -331,7 +331,9 @@ -(IBAction) optDUMBResampling {
331 331
     [mplayer optDUMB_Resampling:sc_DUMBResampling.selectedSegmentIndex];
332 332
 }
333 333
 
334  
-
  334
+-(IBAction) optAOSDK_DSF22KHZ {
  335
+    [mplayer optAOSDK_22KHZ:sc_AOSDKDSF22KHZ.selectedSegmentIndex];
  336
+}
335 337
 -(IBAction) optAOSDK_DSFDSP {
336 338
     [mplayer optAOSDK_DSFDSP:sc_AOSDKDSFDSP.selectedSegmentIndex];
337 339
 }
@@ -2937,6 +2939,7 @@ -(void) updateAllSettingsAfterChange {
2937 2939
     
2938 2940
     [self optAOSDK_DSFEmuRatio];
2939 2941
     [self optAOSDK_DSFDSP];
  2942
+    [self optAOSDK_DSF22KHZ];
2940 2943
     [self optAOSDK_SSFEmuRatio];
2941 2944
     [self optAOSDK_SSFDSP];
2942 2945
     
@@ -3006,6 +3009,7 @@ -(void) loadDefaultSettings {
3006 3009
 	sc_AOSDK_Reverb.selectedSegmentIndex = 1;
3007 3010
 	sc_AOSDK_Interpol.selectedSegmentIndex = 2;
3008 3011
 	sc_AOSDKDSFDSP.selectedSegmentIndex = 0;
  3012
+    sc_AOSDKDSF22KHZ.selectedSegmentIndex = 1;
3009 3013
 	sc_AOSDKDSFEmuRatio.selectedSegmentIndex = 2;
3010 3014
 	sc_AOSDKSSFDSP.selectedSegmentIndex = 0;
3011 3015
 	sc_AOSDKSSFEmuRatio.selectedSegmentIndex = 2;
@@ -3105,6 +3109,7 @@ -(void) loadHighSettings {
3105 3109
     ///////////////////////////////////////
3106 3110
 	sc_AOSDK_Reverb.selectedSegmentIndex = 1;
3107 3111
 	sc_AOSDK_Interpol.selectedSegmentIndex = 2;
  3112
+    sc_AOSDKDSF22KHZ.selectedSegmentIndex = 0;
3108 3113
 	sc_AOSDKDSFDSP.selectedSegmentIndex = 1;
3109 3114
 	sc_AOSDKDSFEmuRatio.selectedSegmentIndex = 0;
3110 3115
 	sc_AOSDKSSFDSP.selectedSegmentIndex = 1;
@@ -3210,6 +3215,7 @@ -(void) loadMedSettings {
3210 3215
     ///////////////////////////////////////
3211 3216
 	sc_AOSDK_Reverb.selectedSegmentIndex = 1;
3212 3217
 	sc_AOSDK_Interpol.selectedSegmentIndex = 1;
  3218
+    sc_AOSDKDSF22KHZ.selectedSegmentIndex = 1;
3213 3219
 	sc_AOSDKDSFDSP.selectedSegmentIndex = 0;
3214 3220
 	sc_AOSDKDSFEmuRatio.selectedSegmentIndex = 2;
3215 3221
 	sc_AOSDKSSFDSP.selectedSegmentIndex = 0;
@@ -3315,6 +3321,7 @@ -(void) loadLowSettings {
3315 3321
     ///////////////////////////////////////
3316 3322
 	sc_AOSDK_Reverb.selectedSegmentIndex = 0;
3317 3323
 	sc_AOSDK_Interpol.selectedSegmentIndex = 0;
  3324
+    sc_AOSDKDSF22KHZ.selectedSegmentIndex = 1;
3318 3325
 	sc_AOSDKDSFDSP.selectedSegmentIndex = 0;
3319 3326
 	sc_AOSDKDSFEmuRatio.selectedSegmentIndex = 3;
3320 3327
 	sc_AOSDKSSFDSP.selectedSegmentIndex = 0;
@@ -3538,6 +3545,9 @@ -(void)loadSettings:(int)safe_mode{
3538 3545
 	valNb=[prefs objectForKey:@"AOSDKReverb"];if (safe_mode) valNb=nil;
3539 3546
 	if (valNb == nil) sc_AOSDK_Reverb.selectedSegmentIndex = 1;
3540 3547
 	else sc_AOSDK_Reverb.selectedSegmentIndex = [valNb intValue];
  3548
+	valNb=[prefs objectForKey:@"AOSDKDSF22KHZ"];if (safe_mode) valNb=nil;
  3549
+	if (valNb == nil) sc_AOSDKDSF22KHZ.selectedSegmentIndex = 1;
  3550
+	else sc_AOSDKDSF22KHZ.selectedSegmentIndex = [valNb intValue];
3541 3551
 	valNb=[prefs objectForKey:@"AOSDKInterp"];if (safe_mode) valNb=nil;
3542 3552
 	if (valNb == nil) sc_AOSDK_Interpol.selectedSegmentIndex = 2;
3543 3553
 	else sc_AOSDK_Interpol.selectedSegmentIndex = [valNb intValue];
@@ -3829,6 +3839,8 @@ -(void)saveSettings{
3829 3839
 	valNb=[[NSNumber alloc] initWithInt:sc_AOSDK_Interpol.selectedSegmentIndex];
3830 3840
 	[prefs setObject:valNb forKey:@"AOSDKInterp"];[valNb autorelease];
3831 3841
     
  3842
+    valNb=[[NSNumber alloc] initWithInt:sc_AOSDKDSF22KHZ.selectedSegmentIndex];
  3843
+	[prefs setObject:valNb forKey:@"AOSDKDSF22KHZ"];[valNb autorelease];
3832 3844
     valNb=[[NSNumber alloc] initWithInt:sc_AOSDKDSFDSP.selectedSegmentIndex];
3833 3845
 	[prefs setObject:valNb forKey:@"AOSDKDSFDSP"];[valNb autorelease];
3834 3846
     valNb=[[NSNumber alloc] initWithInt:sc_AOSDKDSFEmuRatio.selectedSegmentIndex];
1  modizer/Classes/ModizMusicPlayer.h
@@ -207,6 +207,7 @@ extern "C" {
207 207
 -(void) optSEXYPSF:(int)reverb interpol:(int)interpol;
208 208
 -(void) optAOSDK:(int)reverb interpol:(int)interpol;
209 209
 -(void) optADPLUG:(int)opltype;
  210
+-(void) optAOSDK_22KHZ:(int)value;
210 211
 -(void) optAOSDK_DSFDSP:(int)value;
211 212
 -(void) optAOSDK_DSFEmuRatio:(int)value;
212 213
 -(void) optAOSDK_SSFDSP:(int)value;
9  modizer/Classes/ModizMusicPlayer.mm
@@ -1435,6 +1435,9 @@ -(void)timThread {
1435 1435
     char *argv[1];
1436 1436
     argv[0]=tim_filepath;    
1437 1437
     
  1438
+    //timidity
  1439
+    tim_init((char*)[[NSHomeDirectory() stringByAppendingPathComponent:@"modizer.app/timidity"] UTF8String]);
  1440
+    tim_init((char*)[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] UTF8String]);
1438 1441
     
1439 1442
     //tim_init((char*)[[NSHomeDirectory() stringByAppendingPathComponent:@"modizer.app/timidity"] UTF8String]);
1440 1443
     tim_main(1, argv);
@@ -1916,8 +1919,6 @@ -(void) generateSoundThread {
1916 1919
 	NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
1917 1920
 	if ([[NSThread currentThread] respondsToSelector:@selector(setThreadPriority)]) [[NSThread currentThread] setThreadPriority:0.9f];
1918 1921
     
1919  
-    //timidity
1920  
-    tim_init((char*)[[NSHomeDirectory() stringByAppendingPathComponent:@"modizer.app/timidity"] UTF8String]);
1921 1922
     
1922 1923
 	while (1) {
1923 1924
 		[NSThread sleepForTimeInterval:DEFAULT_WAIT_TIME_MS];
@@ -5616,7 +5617,9 @@ -(void) optAOSDK:(int)reverb interpol:(int)interpol {
5616 5617
 	AOSDK_setInterpolation(interpol);
5617 5618
 }
5618 5619
 
5619  
-
  5620
+-(void) optAOSDK_22KHZ:(int)value{
  5621
+    aosdk_dsf_22khz=value;
  5622
+}
5620 5623
 -(void) optAOSDK_DSFDSP:(int)value{
5621 5624
     aosdk_dsfdsp=value;
5622 5625
 }
BIN  modizer/Resources/timidity/TimGM6mb.sf2
Binary file not shown
2,959  modizer/XIB/en.lproj/MainWindow.xib
2953 additions, 6 deletions not shown
2,682  modizer/XIB/fr.lproj/MainWindow.xib
2676 additions, 6 deletions not shown
12  modizer/aosdk/eng_dsf/aica.c
@@ -1354,8 +1354,8 @@ static void AICA_DoMasterSamples(struct _AICA *AICA, int nsamples)
1354 1354
             }
1355 1355
             
1356 1356
         }
1357  
-        *bufl++ = ICLIP16(smpl>>3);
1358  
-        *bufr++ = ICLIP16(smpr>>3);
  1357
+        *bufl++ = ICLIP16(smpl>>2);
  1358
+        *bufr++ = ICLIP16(smpr>>2);
1359 1359
          
1360 1360
 		AICA_TimersAddTicks(AICA, 1);
1361 1361
 		CheckPendingIRQ(AICA);
@@ -1418,11 +1418,11 @@ static void AICA_DoMasterSamples22khz(struct _AICA *AICA, int nsamples)
1418 1418
             
1419 1419
         }
1420 1420
 #if defined(TARGET_OS_IPHONE) && !TARGET_IPHONE_SIMULATOR
1421  
-        __asm__("ssat %0, #16, %1\n\t" : "=r"(*bufl++) : "r"(smpl>>3));
1422  
-        __asm__("ssat %0, #16, %1\n\t" : "=r"(*bufr++) : "r"(smpr>>3));
  1421
+        __asm__("ssat %0, #16, %1\n\t" : "=r"(*bufl++) : "r"(smpl>>2));
  1422
+        __asm__("ssat %0, #16, %1\n\t" : "=r"(*bufr++) : "r"(smpr>>2));
1423 1423
 #else
1424  
-        *bufl++ = ICLIP16(smpl>>3);
1425  
-        *bufr++ = ICLIP16(smpr>>3);
  1424
+        *bufl++ = ICLIP16(smpl>>2);
  1425
+        *bufr++ = ICLIP16(smpr>>2);
1426 1426
 #endif
1427 1427
         
1428 1428
 		AICA_TimersAddTicks(AICA, 2);
BIN  ...zer/modizer.xcodeproj/project.xcworkspace/xcuserdata/ymagnien.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
3  modizer_changes.txt
@@ -6,7 +6,10 @@
6 6
 - DUMB: optimized file loading & memory usage.
7 7
 - Player screen: info & playlist fullscreen state now saved & restored.
8 8
 - Playlist: add subsongs/archives management.
  9
+- Timidity: user's custom timidity.cfg & sound font supported.
  10
+- DSF: output can be switch between 22Khz & 44Khz. Output gain increased.
9 11
 [BugFixes]
  12
+- Dumb: wrong format reported in info screen for IT files.
10 13
 - Issue fixed with archive management & display in player screen.
11 14
 - Fixed crash when modizer is running in background (double free issue).
12 15
 - Fixed long press on '<' & '>' (used to change archive entry when current entry has also sub song).

0 notes on commit 9fd7763

Please sign in to comment.
Something went wrong with that request. Please try again.