Skip to content

Commit

Permalink
v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyofr committed Dec 31, 2012
1 parent a586f62 commit 856488c
Show file tree
Hide file tree
Showing 44 changed files with 5,771 additions and 3,725 deletions.
2 changes: 1 addition & 1 deletion dumb/src/src/it/readmod.c
Expand Up @@ -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++;
Expand Down
Binary file added modizer/AppStore1024.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 71 additions & 1 deletion modizer/Classes/AppDelegate_Phone.mm
Expand Up @@ -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];
}

Expand Down
62 changes: 36 additions & 26 deletions modizer/Classes/DetailViewControllerIphone.mm
Expand Up @@ -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;
Expand All @@ -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];
Expand All @@ -1366,7 +1365,7 @@ -(BOOL)play_curEntry {
return FALSE;
}

[self performSelectorInBackground:@selector(hideWaiting) withObject:nil];
[self performSelectorInBackground:@selector(hideWaiting) withObject:nil];

return TRUE;
}
Expand Down Expand Up @@ -1472,7 +1471,6 @@ -(void)play_listmodules:(NSArray *)array start_index:(int)index path:(NSArray *)
}

[playlistTabView reloadData];

[self play_curEntry];
}

Expand All @@ -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];
Expand Down Expand Up @@ -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];
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -2115,7 +2117,7 @@ -(BOOL)play_module:(NSString *)filePath fname:(NSString *)fileName {

//Is OGLView visible ?
[self checkGLViewCanDisplay];
//Restart management
if (mRestart) {
mRestart=0;
Expand Down Expand Up @@ -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)
Expand All @@ -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"];
Expand Down Expand Up @@ -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];

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
28 changes: 28 additions & 0 deletions modizer/Classes/DownloadViewController.mm
Expand Up @@ -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++;

}
}

Expand Down

0 comments on commit 856488c

Please sign in to comment.