Permalink
Browse files

v1.5beta. Fixed issue with modplug/pattern break. Updated modland to …

…22/01/2012 index and HVSC to #56. Add of OBSlider for variable speed sliders management. Fixed issue with click noise at the end of song for GME lib.
  • Loading branch information...
1 parent 4a6a8a8 commit 93b9566f1d6b4ed1c0a0f1d1e4321d7fa4d43c02 @yoyofr committed Jan 29, 2012
View
@@ -58,7 +58,7 @@ struct gme_t : public Gme_File, private Track_Filter::callbacks_t {
// Sets start time and length of track fade out. Once fade ends track_ended() returns
// true. Fade time must be set after track has been started, and can be changed
// at any time.
- void set_fade( int start_msec, int length_msec = 8000 );
+ void set_fade( int start_msec, int length_msec = 1000 );
// Disables automatic end-of-track detection and skipping of silence at beginning
void ignore_silence( bool disable = true );
@@ -42,7 +42,7 @@
//#define BLIP_BUFFER_FAST 1
// Reduce memory usage of gme.h by disabling gme_set_effects_config().
-#define GME_DISABLE_EFFECTS 1
+//#define GME_DISABLE_EFFECTS 1
// Force library to use assume big-endian processor.
//#define BLARGG_BIG_ENDIAN 1
View
@@ -310,7 +310,7 @@ void gme_set_user_cleanup(Music_Emu* gme, gme_user_cleanup_t func ){ gme->s
gme_err_t gme_start_track ( Music_Emu* gme, int index ) { return gme->start_track( index ); }
gme_err_t gme_play ( Music_Emu* gme, int n, short p [] ) { return gme->play( n, p ); }
-void gme_set_fade ( Music_Emu* gme, int start_msec ) { gme->set_fade( start_msec ); }
+void gme_set_fade ( Music_Emu* gme, int start_msec, int fade_length ) { gme->set_fade( start_msec,fade_length ); }
gme_bool gme_track_ended ( Music_Emu const* gme ) { return gme->track_ended(); }
int gme_tell ( Music_Emu const* gme ) { return gme->tell(); }
gme_err_t gme_seek ( Music_Emu* gme, int msec ) { return gme->seek( msec ); }
View
@@ -44,7 +44,7 @@ void gme_delete( gme_t* );
/* Sets time to start fading track out. Once fade ends track_ended() returns true.
Fade time can be changed while track is playing. */
-void gme_set_fade( gme_t*, int start_msec );
+void gme_set_fade( gme_t*, int start_msec, int fade_length );
/* True if a track has reached its end */
gme_bool gme_track_ended( const gme_t* );
@@ -1208,7 +1208,10 @@ BOOL CSoundFile::ProcessEffects()
if ((nBreakRow >= 0) || (nPosJump >= 0))
{
BOOL bNoLoop = FALSE;
- if (nPosJump < 0) nPosJump = m_nCurrentPattern;//+1; yoyofr fix for modizer
+ if (nPosJump < 0) {
+ if (nBreakRow==0) nPosJump = m_nCurrentPattern+1;
+ else nPosJump = m_nCurrentPattern;
+ }
if (nBreakRow < 0) nBreakRow = 0;
// Modplug Tracker & ModPlugin allow backward jumps
#ifndef MODPLUG_FASTSOUNDLIB
@@ -23,6 +23,8 @@
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
+#import "OBSlider.h"
+
#import "ModizMusicPlayer.h"
#import "AppDelegate_Phone.h"
@@ -109,7 +111,9 @@ class CGLString;
IBOutlet UIButton *mainRating1,*mainRating1off,*mainRating2,*mainRating2off,*mainRating3,*mainRating3off,*mainRating4,*mainRating4off,*mainRating5,*mainRating5off;
IBOutlet UIToolbar *playBar,*pauseBar,*playBarSub,*pauseBarSub;
- IBOutlet UISlider *sliderProgressModule,*surDepSld,*surDelSld,*revDepSld,*revDelSld,*bassAmoSld,*bassRanSld,*mastVolSld,*mpPanningSld,*sldFxAlpha,*sldDUMBMastVol,*sldPanning;
+ IBOutlet OBSlider *sliderProgressModule,*sld_TIMPoly,*sld_DefaultLength;
+
+ IBOutlet UISlider *surDepSld,*surDelSld,*revDepSld,*revDelSld,*bassAmoSld,*bassRanSld,*mastVolSld,*mpPanningSld,*sldFxAlpha,*sldDUMBMastVol,*sldPanning;
IBOutlet UITextView *textMessage;
IBOutlet UITableView *playlistTabView;
IBOutlet UIView *playlistView,*detailView,*commandViewU,*mainView,*infoView;
@@ -131,7 +135,6 @@ class CGLString;
IBOutlet UISegmentedControl *sc_AOSDK_Reverb,*sc_AOSDK_Interpol,*sc_SID_Optim,*sc_SID_LibVersion,*sc_SID_Filter;
IBOutlet UISegmentedControl *sc_ADPLUG_opltype;
IBOutlet UISegmentedControl *sc_TIMreverb,*sc_TIMfilter,*sc_TIMresample,*sc_TIMchorus,*sc_DUMBResampling;
- IBOutlet UISlider *sld_TIMPoly,*sld_DefaultLength;
IBOutlet UILabel *labelTimPolyphony,*labelDUMBMastVol,*lblPanningValue,*labelDefaultLength;
IBOutlet UISlider *sld_UADEpan,*sld_UADEgain;
@@ -323,7 +326,8 @@ class CGLString;
@property (nonatomic, retain) IBOutlet UIButton *pvSubSongValidate,*btnShowSubSong,*pvArcValidate,*btnShowArcList;
@property (nonatomic, retain) IBOutlet UIButton *buttonLoopTitleSel,*buttonLoopList,*buttonLoopListSel,*buttonShuffle,*buttonShuffleSel,*btnLoopInf;
@property (nonatomic, retain) IBOutlet UIToolbar *playBar,*pauseBar,*playBarSub,*pauseBarSub;
-@property (nonatomic, retain) IBOutlet UISlider *sliderProgressModule,*surDepSld,*surDelSld,*revDepSld,*revDelSld,*bassAmoSld,*bassRanSld,*mastVolSld,*mpPanningSld,*sldFxAlpha,*sldDUMBMastVol,*sldPanning,*sld_DefaultLength;
+@property (nonatomic, retain) IBOutlet OBSlider *sliderProgressModule,*sld_TIMPoly,*sld_DefaultLength;
+@property (nonatomic, retain) IBOutlet UISlider *surDepSld,*surDelSld,*revDepSld,*revDelSld,*bassAmoSld,*bassRanSld,*mastVolSld,*mpPanningSld,*sldFxAlpha,*sldDUMBMastVol,*sldPanning;
@property (nonatomic, retain) IBOutlet UITextView *textMessage;
@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;
@@ -339,7 +343,6 @@ class CGLString;
@property (nonatomic, retain) IBOutlet UISegmentedControl *sc_TIMreverb,*sc_TIMfilter,*sc_TIMresample,*sc_TIMchorus,*sc_DUMBResampling;
@property (nonatomic, retain) IBOutlet UISlider *sld_UADEpan,*sld_UADEgain;
-@property (nonatomic, retain) IBOutlet UISlider *sld_TIMPoly;
@property (nonatomic, retain) IBOutlet UILabel *labelTimPolyphony,*labelDUMBMastVol,*lblPanningValue;
@property (nonatomic, retain) IBOutlet UIViewController *textInputView;
@@ -4302,6 +4302,7 @@ - (void)viewDidLoad {
//Init pickerview linebreakmode
// pvArcSel.inputView.
// .lineBreakMode
+
orientationHV=(int)UIInterfaceOrientationPortrait;
@@ -5704,10 +5705,35 @@ - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSIn
return 0;
}
-- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
+/*- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
if (pickerView==pvSubSongSel) return [mplayer getSubTitle:row+mplayer.mod_minsub];
if (pickerView==pvArcSel) return [mplayer getArcEntryTitle:row];
return nil;
+}*/
+- (UIView *)pickerView:(UIPickerView *)pickerView
+ viewForRow:(NSInteger)row
+ forComponent:(NSInteger)component
+ reusingView:(UIView *)view {
+
+ UILabel *pickerLabel = (UILabel *)view;
+
+ if (pickerLabel == nil) {
+ CGRect frame = CGRectMake(0.0, 0.0, pickerView.frame.size.width-32, 32);
+ pickerLabel = [[[UILabel alloc] initWithFrame:frame] autorelease];
+ pickerLabel.lineBreakMode=UILineBreakModeMiddleTruncation;
+ [pickerLabel setTextAlignment:UITextAlignmentLeft];
+ [pickerLabel setBackgroundColor:[UIColor clearColor]];
+ [pickerLabel setFont:[UIFont boldSystemFontOfSize:15]];
+ }
+
+ if (pickerView==pvSubSongSel) [pickerLabel setText:[mplayer getSubTitle:row+mplayer.mod_minsub]];
+ if (pickerView==pvArcSel) [pickerLabel setText:[mplayer getArcEntryTitle:row]];
+
+
+
+
+ return pickerLabel;
+
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
@@ -840,7 +840,7 @@ -(id) initMusicPlayer {
//playOffset=(int*)malloc(SOUND_BUFFER_NB*sizeof(int));
//
//GME specific
- optGMEFadeOut=500;
+ optGMEFadeOut=1000;
//
// ADPLUG specific
mADPLUGopltype=0;
@@ -2016,7 +2016,7 @@ -(void) generateSoundThread {
if (mPlayType==1) { //GME
bGlobalSeekProgress=-1;
gme_seek(gme_emu,mNeedSeekTime);
- //gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 2s before end
+ //gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 2s before end
}
if (mPlayType==2) { //MODPLUG
bGlobalSeekProgress=-1;
@@ -2103,9 +2103,9 @@ -(void) generateSoundThread {
mod_message_updated=2;
if (iModuleLength>0) {
- if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 1s before end
- else gme_set_fade( gme_emu, iModuleLength/2 );
- } else gme_set_fade( gme_emu, 1<<30 );
+ if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 1s before end
+ else gme_set_fade( gme_emu, iModuleLength/2,iModuleLength/2 );
+ } else gme_set_fade( gme_emu, 1<<30,optGMEFadeOut );
if (moveToNextSubSong==2) {
//[self iPhoneDrv_PlayWaitStop];
//[self iPhoneDrv_PlayStart];
@@ -2192,9 +2192,9 @@ -(void) generateSoundThread {
mod_message_updated=2;
if (iModuleLength>0) {
- if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 1s before end
- else gme_set_fade( gme_emu, iModuleLength/2 );
- } else gme_set_fade( gme_emu, 1<<30 );
+ if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 1s before end
+ else gme_set_fade( gme_emu, iModuleLength/2, iModuleLength/2 );
+ } else gme_set_fade( gme_emu, 1<<30,optGMEFadeOut );
if (moveToSubSong==2) {
//[self iPhoneDrv_PlayWaitStop];
//[self iPhoneDrv_PlayStart];
@@ -2283,9 +2283,9 @@ -(void) generateSoundThread {
mod_message_updated=2;
if (iModuleLength>0) {
- if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 1s before end
- else gme_set_fade( gme_emu, iModuleLength/2 ); //Fade 1s before end
- } else gme_set_fade( gme_emu, 1<<30 );
+ if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 1s before end
+ else gme_set_fade( gme_emu, iModuleLength/2,optGMEFadeOut ); //Fade 1s before end
+ } else gme_set_fade( gme_emu, 1<<30,optGMEFadeOut );
[self iPhoneDrv_PlayStop];
[self iPhoneDrv_PlayStart];
iCurrentTime=0;
@@ -2351,6 +2351,7 @@ -(void) generateSoundThread {
} else if (mChangeOfSong==0) {
if ((mSingleSubMode==0)&&(mod_currentsub<mod_maxsub)) {
//NSLog(@"time : %d song:%d",iCurrentTime,mod_currentsub);
+
mod_currentsub++;
gme_start_track(gme_emu,mod_currentsub);
sprintf(mod_name," %s",mod_filename);
@@ -2380,9 +2381,9 @@ -(void) generateSoundThread {
//mod_message_updated=2;
if (mNewModuleLength>0) {
- if (mNewModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, mNewModuleLength-optGMEFadeOut ); //Fade 1s before end
- else gme_set_fade( gme_emu, mNewModuleLength/2 ); //Fade 1s before end
- } else gme_set_fade( gme_emu, 1<<30 );
+ if (mNewModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, mNewModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 1s before end
+ else gme_set_fade( gme_emu, mNewModuleLength/2, mNewModuleLength/2 ); //Fade 1s before end
+ } else gme_set_fade( gme_emu, 1<<30,optGMEFadeOut );
if (mSlowDevice) {
gme_play( gme_emu, SOUND_BUFFER_SIZE_SAMPLE, buffer_ana[buffer_ana_gen_ofs] );
/*for (int i=SOUND_BUFFER_SIZE_SAMPLE/2-1;i>=0;i--) {
@@ -2665,6 +2666,21 @@ -(void) generateSoundThread {
}
if (nbBytes<SOUND_BUFFER_SIZE_SAMPLE*2*2) {
+ short int *dest=buffer_ana[buffer_ana_gen_ofs];
+ short int lv,rv;
+ dest+=nbBytes/4;
+ if (nbBytes>=4) {
+ dest-=2;
+ lv=*dest++;
+ rv=*dest++;
+ } else {
+ lv=buffer_ana[(buffer_ana_gen_ofs+SOUND_BUFFER_NB-1)%SOUND_BUFFER_NB][SOUND_BUFFER_SIZE_SAMPLE-1];
+ rv=buffer_ana[(buffer_ana_gen_ofs+SOUND_BUFFER_NB-1)%SOUND_BUFFER_NB][SOUND_BUFFER_SIZE_SAMPLE-1];
+ }
+ for (int i=nbBytes/4;i<SOUND_BUFFER_SIZE_SAMPLE;i++) {
+ *dest++=lv;
+ *dest++=rv;
+ }
buffer_ana_flag[buffer_ana_gen_ofs]=buffer_ana_flag[buffer_ana_gen_ofs]|4; //end reached
bGlobalEndReached=1;
}
@@ -3638,7 +3654,7 @@ -(int) LoadModule:(NSString*)_filePath defaultMODPLAYER:(int)defaultMODPLAYER sl
//Loop
if (mLoopMode==1) iModuleLength=-1;
- if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 1s before end
+ if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut,optGMEFadeOut ); //Fade 1s before end
// else gme_set_fade( gme_emu, 1<<30);
iCurrentTime=0;
@@ -4415,6 +4431,7 @@ -(int) LoadModule:(NSString*)_filePath defaultMODPLAYER:(int)defaultMODPLAYER sl
UADEstate.config.panning_enable=mUADE_OptPAN;
UADEstate.config.panning=mUADE_OptPANValue;
UADEstate.config.no_ep_end=(mLoopMode==1?1:0);
+// UADEstate.config.use_ntsc=1;
uade_set_effects(&UADEstate);
@@ -5099,8 +5116,8 @@ -(void) PlaySeek:(int)startPos subsong:(int)subsong {
}
//Loop
if (mLoopMode==1) iModuleLength=-1;
- if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ); //Fade 1s before end
- else gme_set_fade( gme_emu, 1<<30);
+ if (iModuleLength>optGMEFadeOut) gme_set_fade( gme_emu, iModuleLength-optGMEFadeOut ,optGMEFadeOut); //Fade 1s before end
+ else gme_set_fade( gme_emu, 1<<30,optGMEFadeOut);
mod_message_updated=2;
}
gme_seek(gme_emu,startPos);
@@ -7,8 +7,8 @@
//
//#define GET_NB_ENTRIES 1
-#define NB_MODLAND_ENTRIES 297435
-#define NB_HVSC_ENTRIES 40400
+#define NB_MODLAND_ENTRIES 297759
+#define NB_HVSC_ENTRIES 41250
#define PRI_SEC_ACTIONS_IMAGE_SIZE 40
#define ROW_HEIGHT 40
@@ -0,0 +1,26 @@
+//
+// OBSlider.h
+//
+// Created by Ole Begemann on 02.01.11.
+// Copyright 2011 Ole Begemann. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface OBSlider : UISlider
+{
+ float scrubbingSpeed;
+ NSArray *scrubbingSpeeds;
+ NSArray *scrubbingSpeedChangePositions;
+
+ CGPoint beganTrackingLocation;
+
+ float realPositionValue;
+}
+
+@property (atomic, assign, readonly) float scrubbingSpeed;
+@property (atomic, retain) NSArray *scrubbingSpeeds;
+@property (atomic, retain) NSArray *scrubbingSpeedChangePositions;
+
+@end
Oops, something went wrong.

0 comments on commit 93b9566

Please sign in to comment.