From 89fdb71c854b2b5081e1cb5ec3e26e1bb93e3b60 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 24 Nov 2010 18:02:06 +0000 Subject: - fix: crash at startup (my fault) - fix: it was possible to add non-medley songs to the medley playlist -> crash in singscreen - updated polish language (thx to Pit33) - deactivate all elements (but not background/video) in singscreen (with "N") git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2751 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDraw.pas | 6 +++++- Game/Code/Classes/URecord.pas | 32 ++++++++---------------------- Game/Code/Classes/UWebCam.pas | 6 +++++- Game/Code/Screens/UScreenOptionsRecord.pas | 16 +++++++-------- Game/Code/Screens/UScreenSing.pas | 5 +++-- Game/Code/Screens/UScreenSong.pas | 3 ++- Game/Code/UltraStar.dpr | 2 +- Game/Code/lib/DSPack/UCaptureWDM.pas | 29 +++++++++++++++++---------- 8 files changed, 50 insertions(+), 49 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index 8b7fd8b4..90efe40e 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -64,7 +64,8 @@ var TickOld: cardinal; TickOld2:cardinal; //end Singbar Mod - ShowNotes: integer; //0=show all; 1=don't show notes+rating; 2=don't show notes, rating, score+score bar; 3=also lyrics + ShowNotes: integer; //0=show all; 1=don't show notes+rating; 2=don't show notes, rating, score+score bar; + //3=also lyrics; 4=hide all @@ -2014,6 +2015,9 @@ var x,y: real; CurTime, TotalTime: real; progress: real; begin + if (ShowNotes>3) then + Exit; + x := Theme.Sing.StaticTimeProgress.x; y := Theme.Sing.StaticTimeProgress.y; width:= Theme.Sing.StaticTimeProgress.w; diff --git a/Game/Code/Classes/URecord.pas b/Game/Code/Classes/URecord.pas index ebb0f5b8..7354d931 100644 --- a/Game/Code/Classes/URecord.pas +++ b/Game/Code/Classes/URecord.pas @@ -301,18 +301,17 @@ var end; end; -// mic: array[0..15] of integer; begin // checks for recording devices and puts them into array; + //Log.LogError('Init recoding devices...'); SetLength(SoundCard, 0); BASS_RecordFree; SC := 0; - //Descr := BASS_RecordGetDeviceDescription(SC); Proceed := BASS_RecordGetDeviceInfo(SC, &Info); - Descr := Info.name; - while {(Descr <> '')} Proceed and not (info.flags and BASS_DEVICE_ENABLED=0) do + while Proceed and not (info.flags and BASS_DEVICE_ENABLED=0) do begin + Descr := Info.name; //If there is another SoundCard with the Same ID, Search an available Name if (IsDuplicate(Descr)) then begin @@ -325,16 +324,15 @@ begin end; SetLength(SoundCard, SC+1); -// Log.LogError('Device #' + IntToStr(SC+1) + ': ' + Descr); + //Log.LogError('Device #' + IntToStr(SC+1) + ': ' + Descr); SoundCard[SC].Description := Descr; - // check for recording inputs -// mic[device] := -1; // default to no change + //check for recording inputs SCI := 0; BASS_RecordInit(SC); Flags := BASS_RecordGetInput(SCI, PSingle(nil)^); InputName := BASS_RecordGetInputName(SCI); -// Log.LogError('Input #' + IntToStr(SCI) + ' (' + IntToStr(Flags) + '): ' + InputName); + //Log.LogError('Input #' + IntToStr(SCI) + ' (' + IntToStr(Flags) + '): ' + InputName); SetLength(SoundCard[SC].Input, 1); SoundCard[SC].Input[SCI].Name := InputName; @@ -347,33 +345,19 @@ begin SetLength(SoundCard[SC].Input, SCI+1); InputName := BASS_RecordGetInputName(SCI); SoundCard[SC].Input[SCI].Name := InputName; -// Log.LogError('Input #' + IntToStr(SCI) + ' (' + IntToStr(Flags) + '): ' + InputName); + //Log.LogError('Input #' + IntToStr(SCI) + ' (' + IntToStr(Flags) + '): ' + InputName); end; -{ if (flags and BASS_INPUT_TYPE_MASK) = BASS_INPUT_TYPE_MIC then begin - mic[device] := input; // auto set microphone - end;} - Inc(SCI); Flags := BASS_RecordGetInput(SCI, PSingle(nil)^); end; -{ if mic[device] <> -1 then begin - Log.LogAnalyze('Found the mic at input ' + IntToStr(Mic[device])) - end else begin - Log.LogAnalyze('Mic not found'); - mic[device] := 0; // setting to the first one (for kxproject) - end; - SoundCard[SC].InputSeleceted := Mic[Device];} - - BASS_RecordFree; Inc(SC); - //Descr := BASS_RecordGetDeviceDescription(SC); Proceed := BASS_RecordGetDeviceInfo(SC, &Info); - Descr := Info.name; end; // while + //Log.LogError('End of Init recoding devices.'); end; end. diff --git a/Game/Code/Classes/UWebCam.pas b/Game/Code/Classes/UWebCam.pas index 5abb7622..9457a28d 100644 --- a/Game/Code/Classes/UWebCam.pas +++ b/Game/Code/Classes/UWebCam.pas @@ -75,6 +75,9 @@ const width = 320; height = 240; +var + IWebCamDevice: TList; + begin if WebCamReady then exit; @@ -84,7 +87,8 @@ begin if(Ini.EnableWebCam=0) then exit; - if (Length(GetCapDevices())-1 < Ini.WebCamID) then + GetCapDevices(IWebCamDevice); + if (Length(IWebCamDevice)-1 < Ini.WebCamID) then Exit; try diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas index ea79fbe3..3ff73cca 100644 --- a/Game/Code/Screens/UScreenOptionsRecord.pas +++ b/Game/Code/Screens/UScreenOptionsRecord.pas @@ -116,16 +116,16 @@ var SCI: integer; begin inherited Create; - + LoadFromTheme(Theme.OptionsRecord); SetLength(ICard, Length(Recording.SoundCard)); - for SC := 0 to High(Recording.SoundCard) do - ICard[SC] := Recording.SoundCard[SC].Description; - if (Length(Recording.SoundCard)>0) then begin + for SC := 0 to High(Recording.SoundCard) do + ICard[SC] := Recording.SoundCard[SC].Description; + SetLength(IInput, Length(Recording.SoundCard[Ini.Card].Input)); for SCI := 0 to High(Recording.SoundCard[Ini.Card].Input) do IInput[SCI] := Recording.SoundCard[Ini.Card].Input[SCI].Name; @@ -136,12 +136,11 @@ begin SelectSlideChannelR := AddSelectSlide(Theme.OptionsRecord.SelectSlideChannelR, Ini.CardList[0].ChannelR, IChannel); end; - IWebCamDevice := GetCapDevices(); + GetCapDevices(IWebCamDevice); if (Length(IWebCamDevice)=0) then Ini.EnableWebCam := 0; SelectSlideWebCamOnOff := AddSelectSlide(Theme.OptionsRecord.SelectSlideWebCamOnOff, Ini.EnableWebCam, IEnableWebCam); - if (Length(IWebCamDevice)>0) then begin if (Length(IWebCamDevice)-1 < Ini.WebCamID) then @@ -155,7 +154,6 @@ begin WebCamPreviewOn := (Ini.EnableWebCam=1); end else WebCamPreviewOn := false; - AddButton(Theme.OptionsRecord.ButtonExit); if (Length(Button[0].Text)=0) then AddButtonText(14, 20, Theme.Options.Description[7]); @@ -169,7 +167,7 @@ begin if not Help.SetHelpID(ID) then Log.LogError('No Entry for Help-ID ' + ID + ' (ScreenOptionsRecord)'); - IWebCamDevice := GetCapDevices(); + GetCapDevices(IWebCamDevice); if (Length(IWebCamDevice)>0) then begin @@ -232,7 +230,7 @@ procedure TScreenOptionsRecord.UpdateWebCam; begin wClose; - IWebCamDevice := GetCapDevices(); + GetCapDevices(IWebCamDevice); if (Length(IWebCamDevice)>0) then begin diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 46f7b63c..70da386b 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -225,7 +225,7 @@ begin Exit; Inc(ShowNotes); - if (ShowNotes>3) then + if (ShowNotes>4) then ShowNotes:=0; end; @@ -1996,7 +1996,8 @@ begin wDraw(WebCam, ScreenAct); // draw static menu (FG) - DrawFG; + if (ShowNotes<4) then + DrawFG; //Medley Countdown if ScreenSong.Mode = smMedley then diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index e69cfcfb..9cc87a41 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -610,7 +610,8 @@ begin if Length(PlaylistMedley.Song)=0 then MakeMedley := false; - end else if (Mode = smNormal) and (Length(getVisibleMedleyArr(msCalculated)) > 0) then + end else if (Mode = smNormal) and (CatSongs.Song[Interaction].Medley.Source>=msCalculated) and + (Length(getVisibleMedleyArr(msCalculated)) > 0) then begin MakeMedley := true; StartMedley(99, msCalculated); diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr index d046d939..ab4559d0 100644 --- a/Game/Code/UltraStar.dpr +++ b/Game/Code/UltraStar.dpr @@ -122,7 +122,7 @@ uses UVideo in 'Classes\UVideo.pas'; const - Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC8'; + Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC9'; var WndTitle: string; diff --git a/Game/Code/lib/DSPack/UCaptureWDM.pas b/Game/Code/lib/DSPack/UCaptureWDM.pas index 156e160a..c483e58a 100644 --- a/Game/Code/lib/DSPack/UCaptureWDM.pas +++ b/Game/Code/lib/DSPack/UCaptureWDM.pas @@ -8,7 +8,7 @@ unit UCaptureWDM; interface uses - Classes, Windows, DSPack, DirectShow9, DSUtil, SDL, ExtCtrls, SyncObjs; + Classes, Windows, DSPack, DirectShow9, DSUtil, SDL, ExtCtrls, SyncObjs, ULog; type TCaptureState = (csPlay, csStop, csDisbaled); @@ -66,27 +66,36 @@ type procedure Stop; end; - function GetCapDevices: TList; function ListMediaTypes(DeviceID: integer): TList; + procedure GetCapDevices(var names: TList); implementation uses Graphics, SysUtils; -function GetCapDevices: TList; +procedure GetCapDevices(var names: TList); var k: Integer; tSysDev: TSysDevEnum; begin - SetLength(Result, 0); - tSysDev := TSysDevEnum.Create(CLSID_VideoInputDeviceCategory); - - SetLength(Result, tSysDev.CountFilters); - for k := 0 to tSysDev.CountFilters - 1 do - Result[k] := tSysDev.Filters[k].FriendlyName; + SetLength(names, 0); + try + tSysDev := TSysDevEnum.Create(CLSID_VideoInputDeviceCategory); + SetLength(names, tSysDev.CountFilters); + for k := 0 to tSysDev.CountFilters - 1 do + names[k] := tSysDev.Filters[k].FriendlyName; + except + SetLength(names, 0); + //Log.LogError('GetCapDevices #4'); + end; - tSysDev.Free; + try + if (tSysDev<>nil) then + tSysDev.Free; + except + //Log.LogError('GetCapDevices #6'); + end; end; function ListMediaTypes(DeviceID: integer): TList; -- cgit v1.2.3