Permalink
Browse files

v1.7

  • Loading branch information...
yoyofr committed Dec 31, 2012
1 parent a586f62 commit 856488cbee2dfd591958cf18afe24765e123f57d
Showing with 5,771 additions and 3,725 deletions.
  1. +1 −1 dumb/src/src/it/readmod.c
  2. BIN modizer/AppStore1024.png
  3. +71 −1 modizer/Classes/AppDelegate_Phone.mm
  4. +36 −26 modizer/Classes/DetailViewControllerIphone.mm
  5. +28 −0 modizer/Classes/DownloadViewController.mm
  6. +153 −30 modizer/Classes/ModizMusicPlayer.mm
  7. +3 −3 modizer/Classes/ModizerConstants.h
  8. +4 −4 modizer/Classes/RootViewControllerIphone.mm
  9. +7 −4 modizer/Classes/RootViewControllerLocalBrowser.mm
  10. +2 −2 modizer/Classes/RootViewControllerPlaylist.mm
  11. +3 −3 modizer/Classes/WebBrowser.mm
  12. BIN modizer/Default-568h@2x.png
  13. BIN modizer/Default-Landscape.png
  14. BIN modizer/Default-Landscape~ipad.png
  15. BIN modizer/Default-Portrait.png
  16. BIN modizer/Default-Portrait~ipad.png
  17. BIN modizer/Default.png
  18. BIN modizer/Default@2x.png
  19. +43 −44 modizer/Resources/DB/STIL.faq
  20. +1,988 −600 modizer/Resources/DB/STIL.txt
  21. 0 modizer/Resources/DB/Songlengths.faq
  22. +2,411 −603 modizer/Resources/DB/Songlengths.txt
  23. +1 −1 modizer/Resources/DB/create_dbMAIN.sql.txt
  24. +1 −1 modizer/Resources/DB/create_dbUSER.sql.txt
  25. BIN modizer/Resources/DB/database.modizerdb
  26. BIN modizer/Resources/DB/databaseMAIN.modizerdb.zip
  27. BIN modizer/Resources/Images/02-redo-green.png
  28. BIN modizer/Resources/Images/02-redo-green@2x.png
  29. BIN modizer/Resources/Images/03-loopback-green.png
  30. BIN modizer/Resources/Images/03-loopback-green@2x.png
  31. BIN modizer/Resources/Images/03-loopback.png
  32. BIN modizer/Resources/Images/03-loopback@2x.png
  33. BIN modizer/Resources/Images/05-shuffle-green@2x.png
  34. BIN modizer/Resources/Images/05-shuffle@2x.png
  35. +213 −212 modizer/XIB/en.lproj/MainWindow.xib
  36. +36 −2,160 modizer/XIB/en.lproj/RootViewController.xib
  37. +5 −4 modizer/XIB/fr.lproj/MainWindow.xib
  38. +3 −1 modizer/en.lproj/Localizable.strings
  39. +3 −1 modizer/fr.lproj/Localizable.strings
  40. BIN modizer/images_arc/Default-568h@2x.png
  41. +704 −4 modizer/modizer-Info.plist
  42. +10 −0 modizer/modizer.entitlements
  43. +39 −15 modizer/modizer.xcodeproj/project.pbxproj
  44. +6 −5 modizer_changes.txt
@@ -631,7 +631,7 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int _drestrict)
/* Work out how many patterns there are. */
sigdata->n_patterns = -1;
- for (i = 0; i < 128; i++)
+ for (i = 0; i < sigdata->n_orders; i++)
if (sigdata->n_patterns < sigdata->order[i])
sigdata->n_patterns = sigdata->order[i];
sigdata->n_patterns++;
View
Binary file not shown.
@@ -203,16 +203,86 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
name:UIPasteboardRemovedNotification
object:[UIPasteboard generalPasteboard]];*/
//
+
+
+ NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
+ if ([url isFileURL]) {
+ NSString *filepath;
+ filepath=[url path];
+ NSRange r;
+ r=[filepath rangeOfString:@"Documents/"];
+ if (r.location!=NSNotFound) {
+ NSString *shortfilepath=[filepath substringFromIndex:r.location];
+ //if (detailViewControlleriPhone.sc_DefaultAction.selectedSegmentIndex==0)
+ //[detailViewControlleriPhone add_to_playlist:shortfilepath fileName:[shortfilepath lastPathComponent] forcenoplay:0];
+
+ int pos=0;
+ int total_entries=0;
+ NSMutableArray *array_label = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *array_path = [[[NSMutableArray alloc] init] autorelease];
+ [array_label addObject:[shortfilepath lastPathComponent]];
+ [array_path addObject:shortfilepath];
+ total_entries=1;
+
+ signed char *tmp_ratings;
+ short int *tmp_playcounts;
+ tmp_ratings=(signed char*)malloc(total_entries*sizeof(signed char));
+ tmp_playcounts=(short int*)malloc(total_entries*sizeof(short int));
+ tmp_ratings[0]=-1;
+ tmp_playcounts[0]=0;
+
+ [detailViewControlleriPhone play_listmodules:array_label start_index:pos path:array_path ratings:tmp_ratings playcounts:tmp_playcounts];
+
+ free(tmp_ratings);
+ free(tmp_playcounts);
+ }
+ }
+
+
if (detailViewControlleriPhone.mPlaylist_size) {
//[detailViewControlleriPhone play_restart]; //Playlist not empty ; try to restart
+
}
#endif
return YES;
}
+- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
+ if ([url isFileURL]) {
+ NSString *filepath;
+ filepath=[url path];
+ NSRange r;
+ r=[filepath rangeOfString:@"Documents/"];
+ if (r.location!=NSNotFound) {
+ NSString *shortfilepath=[filepath substringFromIndex:r.location];
+ //if (detailViewControlleriPhone.sc_DefaultAction.selectedSegmentIndex==0)
+ //[detailViewControlleriPhone add_to_playlist:shortfilepath fileName:[shortfilepath lastPathComponent] forcenoplay:0];
+
+ int pos=0;
+ int total_entries=0;
+ NSMutableArray *array_label = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *array_path = [[[NSMutableArray alloc] init] autorelease];
+ [array_label addObject:[shortfilepath lastPathComponent]];
+ [array_path addObject:shortfilepath];
+ total_entries=1;
+
+ signed char *tmp_ratings;
+ short int *tmp_playcounts;
+ tmp_ratings=(signed char*)malloc(total_entries*sizeof(signed char));
+ tmp_playcounts=(short int*)malloc(total_entries*sizeof(short int));
+ tmp_ratings[0]=-1;
+ tmp_playcounts[0]=0;
+
+ [detailViewControlleriPhone play_listmodules:array_label start_index:pos path:array_path ratings:tmp_ratings playcounts:tmp_playcounts];
+
+ free(tmp_ratings);
+ free(tmp_playcounts);
+ }
+ }
+}
- (void)applicationWillTerminate:(UIApplication *)application {
- [detailViewControlleriPhone saveSettings];
+ [detailViewControlleriPhone saveSettings];
[detailViewControlleriPhone updateFlagOnExit];
}
@@ -1323,7 +1323,7 @@ -(BOOL)play_curEntry {
NSString *fileName;
NSString *filePath;
mIsPlaying=FALSE;
-
+
if (!mPlaylist_size) return FALSE;
if (mPlaylist_pos>mPlaylist_size-1) mPlaylist_pos=0;
@@ -1338,8 +1338,7 @@ -(BOOL)play_curEntry {
[myindex autorelease];
}
-
- [self performSelectorInBackground:@selector(showWaiting) withObject:nil];
+ [self performSelectorInBackground:@selector(showWaiting) withObject:nil];
if ([self play_module:filePath fname:fileName]==FALSE) {
[self remove_from_playlist:mPlaylist_pos];
@@ -1366,7 +1365,7 @@ -(BOOL)play_curEntry {
return FALSE;
}
- [self performSelectorInBackground:@selector(hideWaiting) withObject:nil];
+ [self performSelectorInBackground:@selector(hideWaiting) withObject:nil];
return TRUE;
}
@@ -1472,7 +1471,6 @@ -(void)play_listmodules:(NSArray *)array start_index:(int)index path:(NSArray *)
}
[playlistTabView reloadData];
-
[self play_curEntry];
}
@@ -1482,7 +1480,7 @@ -(void)play_listmodules:(NSArray *)array start_index:(int)index path:(NSArray *)
mRestart_sub=0;
mRestart_arc=0;
mPlayingPosRestart=0;
-
+
if ([array count]>=MAX_PL_ENTRIES) {
NSString *msg_str=[NSString stringWithFormat:NSLocalizedString(@"Too much entries! Playlist will be limited to %d first entries.",@""),MAX_PL_ENTRIES];
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning",@"") message:msg_str delegate:self cancelButtonTitle:NSLocalizedString(@"Close",@"") otherButtonTitles:nil] autorelease];
@@ -1525,8 +1523,8 @@ -(void)play_listmodules:(NSArray *)array start_index:(int)index path:(NSArray *)
mPlaylist_pos++; if (mPlaylist_pos>=mPlaylist_size) mPlaylist_pos=0;
}
}
+
[playlistTabView reloadData];
-
[self play_curEntry];
}
@@ -1901,12 +1899,16 @@ -(BOOL) play_loadArchiveModule {
repeatingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.33 target:self selector:@selector(updateInfos:) userInfo:nil repeats: YES]; //3 times/second
if (sc_cflow.selectedSegmentIndex) {
- if (coverflow.currentIndex!=mPlaylist_pos) {
- coverflow_pos=mPlaylist_pos;
- [coverflow setCurrentIndex:mPlaylist_pos];
- //[coverflow bringCoverAtIndexToFront:mPlaylist_pos animated:YES];
- }
+ if (coverflow.hidden==FALSE) {
+ if (coverflow.numberOfCovers!=mPlaylist_size) [coverflow setNumberOfCovers:mPlaylist_size];
+ if (coverflow.currentIndex!=mPlaylist_pos) {
+ coverflow_pos=mPlaylist_pos;
+ [coverflow setCurrentIndex:mPlaylist_pos];
+ //[coverflow bringCoverAtIndexToFront:mPlaylist_pos animated:YES];
+ }
+ } else coverflow_needredraw=1;
}
+
return TRUE;
}
@@ -1921,7 +1923,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
int retcode;
NSString *filePathTmp;
- mSendStatTimer=0;
+ mSendStatTimer=0;
shouldRestart=0;
if (!filePath) return FALSE;
@@ -1998,6 +2000,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
else mLoadIssueMessage=1;
return FALSE;
}
+
//fix issue with modplug settings reset after load
[self settingsChanged:nil];
@@ -2048,7 +2051,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
cover_view.hidden=FALSE;
} else cover_view.hidden=TRUE;
- //[self checkAvailableCovers:mPlaylist_pos];
+ //[self checkAvailableCovers:mPlaylist_pos];
mPlaylist[mPlaylist_pos].cover_flag=-1;
pvSubSongSel.hidden=true;
@@ -2087,7 +2090,6 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
[labelModuleName setNeedsDisplay];
self.navigationItem.titleView=labelModuleName;
-
labelModuleSize.text=[NSString stringWithFormat:NSLocalizedString(@"Size: %dKB",@""), mplayer.mp_datasize>>10];
if ([mplayer getSongLength]>0) {
if (display_length_mode) labelTime.text=[NSString stringWithFormat:@"%.2d:%.2d", ([mplayer getSongLength]/1000)/60,([mplayer getSongLength]/1000)%60];
@@ -2115,7 +2117,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
//Is OGLView visible ?
[self checkGLViewCanDisplay];
-
+
//Restart management
if (mRestart) {
mRestart=0;
@@ -2159,6 +2161,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
// if (sc_SpokenTitle.selectedSegmentIndex==1) [fliteTTS speakText:[mplayer getModName]];
}
+
mRestart_sub=0;
mRestart_arc=0;
//set volume (if applicable)
@@ -2180,13 +2183,16 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {
}
if (sc_cflow.selectedSegmentIndex) {
- if (coverflow.currentIndex!=mPlaylist_pos) {
- coverflow_pos=mPlaylist_pos;
- [coverflow setCurrentIndex:mPlaylist_pos];
- //[coverflow bringCoverAtIndexToFront:mPlaylist_pos animated:YES];
- }
+ if (coverflow.hidden==FALSE) {
+ if (coverflow.numberOfCovers!=mPlaylist_size) [coverflow setNumberOfCovers:mPlaylist_size];
+ if (coverflow.currentIndex!=mPlaylist_pos) {
+ coverflow_pos=mPlaylist_pos;
+ [coverflow setCurrentIndex:mPlaylist_pos];
+ //[coverflow bringCoverAtIndexToFront:mPlaylist_pos animated:YES];
+ }
+ } else coverflow_needredraw=1;
}
-
+
labelTime.text=@"00:00";
if (mplayer.numChannels) {
if (mplayer.numChannels==1) labelNumChannels.text=[NSString stringWithFormat:@"1 channel"];
@@ -2295,7 +2301,8 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
if (gifAnimation) gifAnimation.frame = CGRectMake(0, 0, mDevice_ww, mDevice_hh-234+82);
oglButton.frame = CGRectMake(0, 82, mDevice_ww, mDevice_hh-234);
volWin.frame= CGRectMake(0, mDevice_hh-64-42, mDevice_ww, 44);
- volumeView.frame = volWin.bounds;
+ volumeView.frame = CGRectMake(volWin.bounds.origin.x+12,volWin.bounds.origin.y,
+ volWin.bounds.size.width-24,volWin.bounds.size.height); //volWin.bounds;
// volumeView.center = CGPointMake((mDevice_ww)/2,32);
// [volumeView sizeToFit];
@@ -2476,7 +2483,8 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
oglButton.frame = CGRectMake(0.0, 82, mDevice_hh, mDevice_ww-104-30);
volWin.frame= CGRectMake(200, 40, mDevice_hh-375, 44);
- volumeView.frame = volWin.bounds;
+ volumeView.frame = CGRectMake(volWin.bounds.origin.x+12,volWin.bounds.origin.y,
+ volWin.bounds.size.width-24,volWin.bounds.size.height); //volWin.bounds;
// volumeView.frame = CGRectMake(10, 0, mDevice_hh-375-10, 44);
// volumeView.center = CGPointMake((mDevice_hh-375)/2,32);
// [volumeView sizeToFit];
@@ -4455,7 +4463,7 @@ - (void)viewDidLoad {
plUnzoom.hidden=YES;
volWin.frame= CGRectMake(0, mDevice_hh-64-42, mDevice_ww, 44);
- volumeView = [[[MPVolumeView alloc] initWithFrame:volWin.bounds] autorelease];
+ volumeView = [[[MPVolumeView alloc] initWithFrame:CGRectMake(volWin.bounds.origin.x+12,volWin.bounds.origin.y,volWin.bounds.size.width-24,volWin.bounds.size.height)/*volWin.bounds*/] autorelease];
// volumeView.center = CGPointMake(mDevice_ww/2,32);
// [volumeView setShowsRouteButton:YES];
// [volumeView sizeToFit];
@@ -4805,6 +4813,8 @@ - (void)viewDidAppear:(BOOL)animated {
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationItem.rightBarButtonItem.customView cache:YES];
[UIView commitAnimations];
+ [playlistTabView reloadData];
+
if (sc_cflow.selectedSegmentIndex) {
if (coverflow_needredraw||(coverflow_plsize!=mPlaylist_size)) {
coverflow_plsize=mPlaylist_size;
@@ -5943,7 +5953,7 @@ - (TKCoverflowCoverView*) coverflowView:(TKCoverflowView*)coverflowView coverAtI
}
- if (mScaleFactor!=1) cover.image = [[UIImage alloc] initWithCGImage:cover.image.CGImage scale:mScaleFactor orientation:UIImageOrientationUp];
+ if (mScaleFactor!=1) cover.image = [[[UIImage alloc] initWithCGImage:cover.image.CGImage scale:mScaleFactor orientation:UIImageOrientationUp] autorelease];
return cover;
}
@@ -444,6 +444,34 @@ - (int)addFTPToDownloadList:(NSString *)filePath ftpURL:(NSString *)ftpPath ftpH
mFTPDownloadQueueDepth++;
+ }
+ //2/SCI => if .sci the .003 patch file should be downloaded as well
+ r.location=NSNotFound;
+ r = [fileName rangeOfString:@".sci" options:NSCaseInsensitiveSearch];
+ if (r.location != NSNotFound) {
+ char *tmp_str_ptr;
+ char tmp_str[1024];
+ NSString *newPath,*newName;
+
+// NSLog(@"FILENAME: %@",filePath);
+// NSLog(@"FILENAME: %@",[filePath stringByDeletingLastPathComponent]);
+
+ newPath=[NSString stringWithFormat:@"%@/%@patch.003",[filePath stringByDeletingLastPathComponent],[fileName substringToIndex:3]];
+ mFilePath[mFTPDownloadQueueDepth]=[[NSString alloc] initWithString:newPath];
+
+ newPath=[NSString stringWithFormat:@"%@/%@patch.003",[ftpPath stringByDeletingLastPathComponent],[fileName substringToIndex:3]];
+ mFTPpath[mFTPDownloadQueueDepth]=[[NSString alloc] initWithString:newPath];
+
+ mFTPhost[mFTPDownloadQueueDepth]=[[NSString alloc] initWithString:ftpHost];
+
+ mFTPFilename[mFTPDownloadQueueDepth]=[[NSString alloc] initWithFormat:@"%@patch.003",[fileName substringToIndex:3]];
+
+ mIsMODLAND[mFTPDownloadQueueDepth]=2; //will be treated as modland but not played
+ mFileSize[mFTPDownloadQueueDepth]=-1;
+ mUsePrimaryAction[mFTPDownloadQueueDepth]=useDefaultAction;
+
+ mFTPDownloadQueueDepth++;
+
}
}
Oops, something went wrong.

0 comments on commit 856488c

Please sign in to comment.