diff --git a/.gitignore b/.gitignore index 1ea3fff8..b02f4019 100644 --- a/.gitignore +++ b/.gitignore @@ -3,32 +3,37 @@ Output/Songs *.mp4 *.pdb /Output/Benchmark.log - /Output/CoverDB.sqlite - /Output/HighscoreDB.sqlite - /Output/PartyModes/*/Code/* - /Output/Vocaluxe.exe* - /Output/Vocaluxe.vshost.exe* - /Output/VocaluxeLib.dll - *.psess - /*.vsp - /*.ctl - /Output/Registration.xml - /Vocaluxe.suo /Vocaluxe/Vocaluxe.csproj.user - /Output/Config.xml - *.ipch - *.log +/Output/Playlists/*.xml +/Output/x64/gstreamer/GstreamerHelper.dll +*.tlog +*.suo +*.obj +*.lastbuildstate +*.pch +*.idb +*.exp +*.ilk +*.lib +*.opensdf +*.sdf +*.codeanalysis* +*.nativecodeanalysis* +*.lastcodeanalysissucceeded +/PartyModes/*/*/*.dll + +*.Cache diff --git a/CheckingRules.ruleset b/CheckingRules.ruleset new file mode 100644 index 00000000..de4b78c7 --- /dev/null +++ b/CheckingRules.ruleset @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite/src/parse_c.cs b/Community.CsharpSqlite/src/parse_c.cs index 6875b256..abfea0f1 100644 --- a/Community.CsharpSqlite/src/parse_c.cs +++ b/Community.CsharpSqlite/src/parse_c.cs @@ -1540,8 +1540,6 @@ yyGrowStack(pParser); sqlite3IdListDelete( pParse.db, ref ( yypminor.yy90 ).b ); //#line 1473 "parse.c" } - break; - default: break; /* If no destructor action specified: do nothing */ } } diff --git a/GstreamerHelper/GstreamerAudioStream.cpp b/GstreamerHelper/GstreamerAudioStream.cpp index 1aa4d4c9..212b9eaa 100644 --- a/GstreamerHelper/GstreamerAudioStream.cpp +++ b/GstreamerHelper/GstreamerAudioStream.cpp @@ -184,11 +184,9 @@ void GstreamerAudioStream::RefreshDuration() { if(Element) { - gint64 time; - if(!gst_element_query_duration(Element, GST_FORMAT_TIME, &time)) { - LogError("Could not query duration"); - } - Duration = (gfloat)((gdouble)(time/GST_SECOND)); + gint64 time = -1000; + if(gst_element_query_duration(Element, GST_FORMAT_TIME, &time)) + Duration = (gfloat)((gdouble)(time/GST_SECOND)); } } @@ -196,9 +194,11 @@ float GstreamerAudioStream::GetPosition() { if(Element) { - gint64 time; - gst_element_query_position(Element, GST_FORMAT_TIME, &time); - return (float)((gdouble)time/GST_SECOND); + gint64 time = 0; + if (gst_element_query_position(Element, GST_FORMAT_TIME, &time)) + return (float)((gdouble)time/GST_SECOND); + else + return -1; } else return -1; } diff --git a/GstreamerHelper/GstreamerHelper.vcxproj b/GstreamerHelper/GstreamerHelper.vcxproj index 6ade9eb8..8e692fe5 100644 --- a/GstreamerHelper/GstreamerHelper.vcxproj +++ b/GstreamerHelper/GstreamerHelper.vcxproj @@ -77,6 +77,7 @@ ..\Output\x64\gstreamer\ $(MSBuildProjectDirectory)\x64\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x64\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x64\include\glib-2.0;$(MSBuildProjectDirectory)\x64\include;$(IncludePath) $(MSBuildProjectDirectory)\x64\lib;$(LibraryPath) + ..\CheckingRules.ruleset false diff --git a/GstreamerHelper/GstreamerVideo.cpp b/GstreamerHelper/GstreamerVideo.cpp index 7834eef1..ab025608 100644 --- a/GstreamerHelper/GstreamerVideo.cpp +++ b/GstreamerHelper/GstreamerVideo.cpp @@ -19,7 +19,7 @@ DllExport bool InitVideo() #if _WIN64 SetDllDirectory(L".\\x64\\gstreamer"); #else - SetDllDirectory(L".\\x86\gstreamer"); + SetDllDirectory(L".\\x86\\gstreamer"); #endif gst_init(NULL, NULL); @@ -65,7 +65,7 @@ DllExport bool CloseVideo(int Stream) DllExport int GetVideoNumStreams() { - return VideoStreams.size(); + return (int) VideoStreams.size(); } DllExport float GetVideoLength(int Stream) @@ -85,6 +85,13 @@ DllExport struct ApplicationFrame GetFrame(int Stream, float Time) { return it->second->GetFrame(Time); } + struct ApplicationFrame returnFrame; + returnFrame.size=0; + returnFrame.width=0; + returnFrame.height=0; + returnFrame.data=NULL; + returnFrame.videotime=0; + return returnFrame; } DllExport bool Skip(int Stream, float Start, float Gap) diff --git a/GstreamerHelper/GstreamerVideoStream.cpp b/GstreamerHelper/GstreamerVideoStream.cpp index d67f4656..93c98df0 100644 --- a/GstreamerHelper/GstreamerVideoStream.cpp +++ b/GstreamerHelper/GstreamerVideoStream.cpp @@ -180,7 +180,7 @@ struct ApplicationFrame GstreamerVideoStream::GetFrame(float Time) gst_buffer_map(Buffer, &Mapinfo, GST_MAP_READ); - Size = Mapinfo.size; + Size = (int) Mapinfo.size; gst_structure_get_int (BufferStructure, "width", &Width); gst_structure_get_int (BufferStructure, "height", &Height); VideoTime = (float) (Buffer->pts / GST_SECOND); @@ -210,7 +210,7 @@ struct ApplicationFrame GstreamerVideoStream::GetFrame(float Time) bool GstreamerVideoStream::Skip(float Start, float Gap) { - if(!gst_element_seek_simple(Element, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE), (Start + Gap) * GST_SECOND)) + if(!gst_element_seek_simple(Element, GST_FORMAT_TIME, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE), (gint64)((Start + Gap) * GST_SECOND))) { LogVideoError("Seek failed"); return true; diff --git a/GstreamerHelper/GstreamerVideoStream.h b/GstreamerHelper/GstreamerVideoStream.h index 29183571..7d69e019 100644 --- a/GstreamerHelper/GstreamerVideoStream.h +++ b/GstreamerHelper/GstreamerVideoStream.h @@ -57,7 +57,7 @@ private: volatile gboolean Copying; gboolean Paused; - gboolean Finished; + bool Finished; gfloat Duration; diff --git a/Output/CreditsRessourcesDB.sqlite b/Output/CreditsRessourcesDB.sqlite index dbfe78bb..3f960232 100644 Binary files a/Output/CreditsRessourcesDB.sqlite and b/Output/CreditsRessourcesDB.sqlite differ diff --git a/Output/Fonts/Fonts.xml b/Output/Fonts/Fonts.xml index 70524adf..2bbf61c3 100644 --- a/Output/Fonts/Fonts.xml +++ b/Output/Fonts/Fonts.xml @@ -1,29 +1,31 @@  - - Normal - 0,00 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - Outline - 0,10 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - + + + Normal + 0,00 + 0,00 + 0,00 + 0,00 + 1,00 + FreeSans + FreeSans.ttf + FreeSansBold.ttf + FreeSansOblique.ttf + FreeSansBoldOblique.ttf + + + Outline + 0,10 + 0,00 + 0,00 + 0,00 + 1,00 + FreeSans + FreeSans.ttf + FreeSansBold.ttf + FreeSansOblique.ttf + FreeSansBoldOblique.ttf + + \ No newline at end of file diff --git a/Output/Languages/Dutch.xml b/Output/Languages/Dutch.xml new file mode 100644 index 00000000..4f974b41 --- /dev/null +++ b/Output/Languages/Dutch.xml @@ -0,0 +1,199 @@ + + + Nederlands + Vocaluxe + en + Afsluiten + Opslaan + Terug + Start + Geluidstreams + Videostreams + Structuren + ToneAbs + Maximaal Volume + Liedjes geladen + Muis + Normaal + Duet + Medley + Korte versie + Vocale Held + Superster + Hoofdzanger + Ster in wording + Hoopvol + Wannabe + Amateur + Toondoof + Software + OpenGL + Direct3D + Laagst + Laag + Medium + Hoog + Hoogst + Uit + Aan + Alleen FPS + Niveau 1 + Niveau 2 + Niveau 3 + Max + Lijst + Dreidel + Tegels + Boek + Op aanvraag + Bij het opstarten + Dynamisch + Geen + Willekeurig + Map + Artiest + Artiestletter + Tegelletter + Editie + Genre + Jaar + Decennium + Taal + Eenvoudig + Normaal + Moeilijk + Huidig + Te gaan + Totaal + Normaal + Uitgebreid + Eigen Muziek en Achtergrondmuziek + Geen eigen Muziek + Alleen eigen Muziek + Alles + Alleen namen en avatars + Niets + Laden + Totaal + Liedjes + geladen + Hoofdmenu + Zing + Party + Instellingen + Profielen + Partymodus Selectie + Partymodus + Omschrijving + Auteur + Versie + Kan deze Partymodus niet laden + Doelgroep + Geen teams + Aantal teams + Aantal spelers + Spelerselectie + Speler + 1 Speler + 2 Spelers + 3 Spelers + 4 Spelers + 5 Spelers + 6 Spelers + Waarschuwing: Er is geen microfoon toegewezen aan speler %v! + Waarschuwing: Er zijn geen microfoons toegewezen aan spelers %v! + Waarschuwing: Er is geen profiel toegewezen aan speler %v! + Waarschuwing: Er zijn geen profielen toegewezen aan spelers %v! + Liedjesselectie + Zing + Toevoegen aan afspeellijst + Sluiten + Kies een willekeurig liedje + Kies een willekeurige categorie + Zing alle liedjes + Zing alle zichtbare liedjes + Open afspeellijst + Zing een willekeurige medley + Zing medleyliedjes + Nieuwe afspeellijst + Liedjesopties + Zoek: + Geen taal + Geen jaar + Geen genre + Geen editie + Alle liedjes + (%v Liedjes) + (%v Liedje) + Pauze + Stop met zingen + Doorgaan + Sla dit liedje over + Scores + Beoordeling + Punten + Moeilijkheidsgraad + Totaalscore + Highscore + Profielen + Spelernaam + Moeilijkheidsgraad + Avatar + Gastprofiel + Actief + Nieuw + Verwijderen + Maak Screenshot + Bewaar Screenshot + Verwijder Screenshot + Webcam + Menu-opties + Spel + Geluid + Opname + Video + Songteksten + Thema + Spelinstellingen + Taal + Debug Niveau + Liedjesmenu + Sorteren Liedjes + Tabs + Moeilijkheidsgraad + Timermodus + Opname-opties + Apparaat + Input + Kanaal 1 + Kanaal 2 + Microfoonvertraging + Waarschuwing: Ten minste één speler is toegewezen aan twee microfoons. + Vertragingstest + Geluidsopties + Achtergrondmuziek + Volume Achtergrondmuziek + Bron Achtergrondmuziek + Preview Muziekvolume + Spel Muziekvolume + Thema-opties + Thema + Skin + Coverthema + Toon Nootlijnen + Toon Toonhelper + Uiterlijk Timer + Fade Spelerinformatie + Gedrag Laden Covers + Songtekstopties + Stijl + Songteksten bovenaan + Video-opties + Videoachtergronden + Videopreview + Video tijdens zingen + Toon huidige achtergrondmuziekvideo + Webcams + Webcaminstellingen + Volume + diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index e6c32d03..42460ca7 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -112,6 +112,7 @@ Sing all songs Sing all visible songs Open playlist + Select Sing a random medley Sing medley-songs New Playlist diff --git a/Output/Languages/German.xml b/Output/Languages/German.xml index 52cbba63..7fe3cf73 100644 --- a/Output/Languages/German.xml +++ b/Output/Languages/German.xml @@ -112,6 +112,7 @@ Alle Songs singen Alle sichtbaren Songs singen Playlist öffnen + Auswählen Zufälliges Medley singen Medley-Songs singen Neue Playlist diff --git a/Output/Languages/Turkish.xml b/Output/Languages/Turkish.xml new file mode 100644 index 00000000..0b1cc669 --- /dev/null +++ b/Output/Languages/Turkish.xml @@ -0,0 +1,199 @@ + + + Türkçe + Vocaluxe + ve + Çıkış + Kaydet + Geri + Başla + Ses akışları + Video akışları + Desenler + ABS Tonu + Max Ses + Yüklenen şarkılar + Fare + Normal + Düet + Potpuri + Kısa versiyon + Sözlü Kahraman + Süperstar + Solist + Yükselen Yıldız + Ümit Vaadeden + Taklitçi + Amatör + Müzik Kulağı Olmayan + Yazılım + OpenGL + Direct3D + En düşük + Düşük + Orta + Yüksek + En Yüksek + Kapalı + Açık + Sadece FPS + Seviye 1 + Seviye 2 + Seviye 3 + Max + Liste + Dreidel + Döşemeli Pano + Kitap + İstek Üzerine + Başlangıçta + Dinamik + Yok + Rasgele + Klasör + Sanatçı + Sanatçı Harfi + Başlık Harfi + Basım + Tür + Yıl + On yıl + Dil + Kolay + Normal + Zor + Şimdiki + Kalan + Toplam + Normal + Genişletilmiş + Kendi Müziğiniz ve Arkaplan Müziği + Hiç kendi müziğiniz yok + Sadece kendi Müziğim + Hepsi + Sadece isimler ve fotoğrafları + Hiçbirşey + Yükleniyor + Toplam + Şarkılar + yüklendi + Ana Menü + Şarkı + Parti + Seçenekler + Profiller + Parti Modu Seçeneği + Parti Modu + Açıklama + Yazar + Sürüm + Bu parti modu yüklenemedi + Hedef dinleyici + Takım yok + Takım sayısı + Oyuncu sayısı + Oyuncu Seçimi + Oyuncu + 1 Oyuncu + 2 Oyunculu + 3 Oyunculu + 4 Oyunculu + 5 Oyunculu + 6 Oyunculu + Uyarı: %v oyuncusu için hiç mikrofon atanmadı! + Uyarı: %v oyuncuları için hiç mikrofon atanmadı! + Uyarı: %v oyuncusu için hiç profil atanmadı! + Uyarı: %v oyuncuları için hiç profil atanmadı! + Şarkı Seçimi + Şarkı Söyle + Çalma Listesine Ekle + Kapat + Rastgele bir şarkı seç + Rastgele bir kategori seç + Tüm şarkıları söyle + Tüm görünür şarkıları söyle + Çalma listesini aç + Rastgele bir potpuri söyle + Potpuri şarkılarını söyle + Yeni Çalma Listesi + Şarkı Seçenekleri + Arama: + Dil yok + Yıl yok + Tür yok + Basım yok + Tüm Şarkılar + (%v Şarkıları) + (%v Şarkısı) + Duraklat + Şarkı söylemeyi durdur + Devam et + Bu şarkıyı atla + Skorlar + Derecelendirme + Puanlar + Zorluk Derecesi + Genel skor + Yüksek skor + Profiller + Oyuncu Adı + Oyun Zorluğu + Profil Resmi + Misafir Profili + Aktif + Yeni + Sil + Ekran Görüntüsü Al + Ekran Görüntüsünü Kaydet + Ekran Görüntüsünü Sil + Webcam + Menü Seçenekleri + Oyun + Ses + Kayıt + Video + Sözler + Tema + Oyun Seçenekleri + Dil + Hata Ayıklama Seviyesi + Şarkı Menüsü + Şarkı Sıralama + Sekmeler + Oyun Zorluğu + Zamanlayıcı Modu + Kaydetme Seçenekleri + Aygıt + Giriş + Kanal 1 + Kanal 2 + Mikrofon Gecikmesi + Uyarı: Tek oyuncuya iki mikrofon atandı. + Gecikme Testi + Ses Seçenekleri + Arka Plan Müziği + Arka Plan Müziği Seviyesi + Arka Plan Müziği Kaynağı + Ön İzleme Müziği Seviyesi + Oyun Müziği Seviyesi + Tema Seçenekleri + Tema + Renk + Kapak Teması + Not Çizgilerini Göster + Ton Yardımcısını Göster + Kronometre Bakışı + Oyuncu Bilgisini Kapat + Kapak Yüklenme Davranışı + Şarkı Sözü Seçenekleri + Tarz + Sözler Yukarıda Gösterilsin + Video Seçenekleri + Video Arka Planları + Video Önizleme + Şarkı Söylerken Videoları Gösterme + Mevcut Arka Plan Müziği Videosunu Göster + Web Kameraları + Web Kameraları Özellikleri + Ses + diff --git a/Output/PartyModes/Challenge/Fonts/Fonts.xml b/Output/PartyModes/Challenge/Fonts/Fonts.xml deleted file mode 100644 index 70524adf..00000000 --- a/Output/PartyModes/Challenge/Fonts/Fonts.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - Normal - 0,00 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - Outline - 0,10 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - \ No newline at end of file diff --git a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSans.ttf b/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSans.ttf deleted file mode 100644 index 6de62ebf..00000000 Binary files a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSans.ttf and /dev/null differ diff --git a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBold.ttf b/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBold.ttf deleted file mode 100644 index e75685be..00000000 Binary files a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBold.ttf and /dev/null differ diff --git a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBoldOblique.ttf b/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBoldOblique.ttf deleted file mode 100644 index ec3bc02c..00000000 Binary files a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansBoldOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansOblique.ttf b/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansOblique.ttf deleted file mode 100644 index 733f8829..00000000 Binary files a/Output/PartyModes/Challenge/Fonts/FreeSans/FreeSansOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/Challenge/Fonts/FreeSans/readme.txt b/Output/PartyModes/Challenge/Fonts/FreeSans/readme.txt deleted file mode 100644 index 33ccd11d..00000000 --- a/Output/PartyModes/Challenge/Fonts/FreeSans/readme.txt +++ /dev/null @@ -1,40 +0,0 @@ -Congratulations, you have successfully downloaded font file! - -This font is provided to you by Fonts2u.com – the largest online -repository of free fonts for Windows and Mac. - - - -How to install this font on your computer? - -For Windows 7 / Vista users: - -- Right-click the font file(s) and choose "Install". - -For users of the previous Windows versions: - -- Copy the included file(s) into a default Windows font folder - (usually C:\WINDOWS\FONTS or C:\WINNT\FONTS) - -For Mac users: - -Mac OS X 10.3 or above (including the FontBook) - -- Double-click the font file and hit "Install font" button at - the bottom of the preview. - -Mac OS X - -- Either copy the font file(s) to /Library/Fonts (for all users), - or to /Users/Your_username/Library/Fonts (for you only). - -Mac OS 9 or earlier - -- You have to convert the font file(s) you have downloaded. - Drag the font suitcases into the System folder. The system - will propose you to add them to the Fonts folder. - -For Linux users: - -- Copy the font file(s) to /USR/SHARE/FONTS - diff --git a/Output/PartyModes/Challenge/Languages/Dutch.xml b/Output/PartyModes/Challenge/Languages/Dutch.xml new file mode 100644 index 00000000..07af44e1 --- /dev/null +++ b/Output/PartyModes/Challenge/Languages/Dutch.xml @@ -0,0 +1,29 @@ + + + Engels + Uitdaging + Speel Uitdaging. + Voor iedereen geïnteresseerd in duelleren. + Volgende + Vorige + Start + Afsluiten + Ja + Nee + Volgende Ronde + Uitdaging: Configuratie + Aantal spelers + Aantal microfoons + Aantal rondes + Uitdaging: Kies speler + Uitdaging: Overzicht + # + Naam + Rondes + Overwinningen + Zingpunten + Score + Wil je echt afsluiten? + Speler van volgende ronde: + Alle rondes zijn gezongen! De winnaar is... + diff --git a/Output/PartyModes/Challenge/Languages/Turkish.xml b/Output/PartyModes/Challenge/Languages/Turkish.xml new file mode 100644 index 00000000..9ba850ee --- /dev/null +++ b/Output/PartyModes/Challenge/Languages/Turkish.xml @@ -0,0 +1,29 @@ + + + Türkçe + Yarışma Modu + Biraz yarışma turu oyna. + Düello yarışmalarıyla ilgilenen herkes için. + Sonraki + Önceki + Başla + Çıkış + Evet + Hayır + Sonraki Tur + Yarışma Modu: Yapılandırma + Oyuncu sayısı + Mikrofon sayısı + Tur sayısı + Yarışma Modu: Oyuncu Seçiniz + Yarışma Modu: Genel Bakış + Pozisyon + İsim + Turlar + Kazanma + Şarkı Söyleme Puanı + Skor + Gerçekten çıkmak istiyor musunuz? + Sonraki turun oyuncusu: + Tüm turlar tamamlandı! Kazanan... + diff --git a/Output/PartyModes/ChallengeMedley.xml b/Output/PartyModes/ChallengeMedley.xml index 618d3000..7e1d6605 100644 --- a/Output/PartyModes/ChallengeMedley.xml +++ b/Output/PartyModes/ChallengeMedley.xml @@ -6,14 +6,14 @@ brunzel TR_PARTYMODE_DESCRIPTION ChallengeMedley - PartyModeChallenge + PartyModeChallengeMedley 0 1 TR_PARTYMODE_AUDIENCE - PartyScreenChallengeMain - PartyScreenChallengeConfig - PartyScreenChallengeNames + PartyScreenChallengeMedleyMain + PartyScreenChallengeMedleyConfig + PartyScreenChallengeMedleyNames \ No newline at end of file diff --git a/Output/PartyModes/ChallengeMedley/Fonts/Fonts.xml b/Output/PartyModes/ChallengeMedley/Fonts/Fonts.xml deleted file mode 100644 index 70524adf..00000000 --- a/Output/PartyModes/ChallengeMedley/Fonts/Fonts.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - Normal - 0,00 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - Outline - 0,10 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - \ No newline at end of file diff --git a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSans.ttf b/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSans.ttf deleted file mode 100644 index 6de62ebf..00000000 Binary files a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSans.ttf and /dev/null differ diff --git a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBold.ttf b/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBold.ttf deleted file mode 100644 index e75685be..00000000 Binary files a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBold.ttf and /dev/null differ diff --git a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBoldOblique.ttf b/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBoldOblique.ttf deleted file mode 100644 index ec3bc02c..00000000 Binary files a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansBoldOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansOblique.ttf b/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansOblique.ttf deleted file mode 100644 index 733f8829..00000000 Binary files a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/FreeSansOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/readme.txt b/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/readme.txt deleted file mode 100644 index 33ccd11d..00000000 --- a/Output/PartyModes/ChallengeMedley/Fonts/FreeSans/readme.txt +++ /dev/null @@ -1,40 +0,0 @@ -Congratulations, you have successfully downloaded font file! - -This font is provided to you by Fonts2u.com – the largest online -repository of free fonts for Windows and Mac. - - - -How to install this font on your computer? - -For Windows 7 / Vista users: - -- Right-click the font file(s) and choose "Install". - -For users of the previous Windows versions: - -- Copy the included file(s) into a default Windows font folder - (usually C:\WINDOWS\FONTS or C:\WINNT\FONTS) - -For Mac users: - -Mac OS X 10.3 or above (including the FontBook) - -- Double-click the font file and hit "Install font" button at - the bottom of the preview. - -Mac OS X - -- Either copy the font file(s) to /Library/Fonts (for all users), - or to /Users/Your_username/Library/Fonts (for you only). - -Mac OS 9 or earlier - -- You have to convert the font file(s) you have downloaded. - Drag the font suitcases into the System folder. The system - will propose you to add them to the Fonts folder. - -For Linux users: - -- Copy the font file(s) to /USR/SHARE/FONTS - diff --git a/Output/PartyModes/ChallengeMedley/Languages/Dutch.xml b/Output/PartyModes/ChallengeMedley/Languages/Dutch.xml new file mode 100644 index 00000000..cb09ce08 --- /dev/null +++ b/Output/PartyModes/ChallengeMedley/Languages/Dutch.xml @@ -0,0 +1,29 @@ + + + Engels + Uitdaging Medley + Speel Uitdaging met alleen 5 Medleys + Voor iedereen geïnteresseerd in duelleren en Medleys. + Volgende + Vorige + Start + Afsluiten + Ja + Nee + Volgende Ronde + Uitdaging Medley: Configuratie + Aantal spelers + Aantal microfoons + Aantal rondes + Uitdaging Medley: Kies speler + Uitdaging Medley: Overzicht + # + Naam + Rondes + Overwinningen + Zingpunten + Score + Wil je echt afsluiten? + Speler van volgende ronde: + Alle rondes zijn gezonden! De winnaar is... + diff --git a/Output/PartyModes/ChallengeMedley/Languages/Turkish.xml b/Output/PartyModes/ChallengeMedley/Languages/Turkish.xml new file mode 100644 index 00000000..4085291f --- /dev/null +++ b/Output/PartyModes/ChallengeMedley/Languages/Turkish.xml @@ -0,0 +1,29 @@ + + + Türkçe + Potpuri Yarış Modu + Sadece 5 Potpuri kullanarak yarışma turları oyna. + Düel yarışmaları ve Potpuri ile ilgilenen herkes için. + Sonraki + Önceki + Başla + Çık + Evet + Hayır + Sonraki Tur + Potpuri Yarış Modu: Yapılandırma + Oyuncu sayısı + Mikrofon sayısı + Tur sayısı + Potpuri Yarışma Modu: Oyuncu Seçimi + Potpuri Yarışma Modu: Genel Bakış + Pos + İsim + Tur + Kazanma + Şarkı Söyleme Puanı + Skor + Gerçekten çıkmak istiyor musunuz? + Sonraki tur oyuncusu: + Tüm turlar tamamlandı! Kazanan... + diff --git a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeConfig.xml b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyConfig.xml similarity index 99% rename from Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeConfig.xml rename to Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyConfig.xml index 6581aa77..cda12131 100644 --- a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeConfig.xml +++ b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyConfig.xml @@ -1,6 +1,6 @@ - + 1 @@ -454,5 +454,5 @@ 10 - + diff --git a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMain.xml b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyMain.xml similarity index 99% rename from Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMain.xml rename to Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyMain.xml index 34733ff1..c5f7bc22 100644 --- a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMain.xml +++ b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyMain.xml @@ -1,6 +1,6 @@ - + 1 @@ -981,5 +981,5 @@ - + diff --git a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeNames.xml b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyNames.xml similarity index 99% rename from Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeNames.xml rename to Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyNames.xml index 9d033c03..284b495e 100644 --- a/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeNames.xml +++ b/Output/PartyModes/ChallengeMedley/Screens/PartyScreenChallengeMedleyNames.xml @@ -1,6 +1,6 @@ - + 1 @@ -270,5 +270,5 @@ - + diff --git a/Output/PartyModes/TicTacToe/Fonts/Fonts.xml b/Output/PartyModes/TicTacToe/Fonts/Fonts.xml deleted file mode 100644 index 70524adf..00000000 --- a/Output/PartyModes/TicTacToe/Fonts/Fonts.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - Normal - 0,00 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - - Outline - 0,10 - 0,00 - 0,00 - 0,00 - 1,00 - FreeSans - FreeSans.ttf - FreeSansBold.ttf - FreeSansOblique.ttf - FreeSansBoldOblique.ttf - - \ No newline at end of file diff --git a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSans.ttf b/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSans.ttf deleted file mode 100644 index 6de62ebf..00000000 Binary files a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSans.ttf and /dev/null differ diff --git a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBold.ttf b/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBold.ttf deleted file mode 100644 index e75685be..00000000 Binary files a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBold.ttf and /dev/null differ diff --git a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBoldOblique.ttf b/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBoldOblique.ttf deleted file mode 100644 index ec3bc02c..00000000 Binary files a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansBoldOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansOblique.ttf b/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansOblique.ttf deleted file mode 100644 index 733f8829..00000000 Binary files a/Output/PartyModes/TicTacToe/Fonts/FreeSans/FreeSansOblique.ttf and /dev/null differ diff --git a/Output/PartyModes/TicTacToe/Fonts/FreeSans/readme.txt b/Output/PartyModes/TicTacToe/Fonts/FreeSans/readme.txt deleted file mode 100644 index 33ccd11d..00000000 --- a/Output/PartyModes/TicTacToe/Fonts/FreeSans/readme.txt +++ /dev/null @@ -1,40 +0,0 @@ -Congratulations, you have successfully downloaded font file! - -This font is provided to you by Fonts2u.com – the largest online -repository of free fonts for Windows and Mac. - - - -How to install this font on your computer? - -For Windows 7 / Vista users: - -- Right-click the font file(s) and choose "Install". - -For users of the previous Windows versions: - -- Copy the included file(s) into a default Windows font folder - (usually C:\WINDOWS\FONTS or C:\WINNT\FONTS) - -For Mac users: - -Mac OS X 10.3 or above (including the FontBook) - -- Double-click the font file and hit "Install font" button at - the bottom of the preview. - -Mac OS X - -- Either copy the font file(s) to /Library/Fonts (for all users), - or to /Users/Your_username/Library/Fonts (for you only). - -Mac OS 9 or earlier - -- You have to convert the font file(s) you have downloaded. - Drag the font suitcases into the System folder. The system - will propose you to add them to the Fonts folder. - -For Linux users: - -- Copy the font file(s) to /USR/SHARE/FONTS - diff --git a/Output/PartyModes/TicTacToe/Languages/Dutch.xml b/Output/PartyModes/TicTacToe/Languages/Dutch.xml new file mode 100644 index 00000000..32015cfc --- /dev/null +++ b/Output/PartyModes/TicTacToe/Languages/Dutch.xml @@ -0,0 +1,34 @@ + + + Engels + Drie-op-een-rij + Speel Drie-op-een-rij op een speciale manier + Grappige rondes met strategie, geluk en kunde + Volgende + Vorige + Start + Afsluiten + Ja + Nee + Start + Liedjes + Team + Afspeellijst + Categorie + Alle liedjes + Drie-op-een-rij: configuratie + Aantal spelers in team 1 + Aantal spelers in team 2 + Aantal vakjes + Liedjesbron + Spelmodus + Drie-op-een-rij: Kies speler + Team 1 + Team 2 + Drie-op-een-rij + Kies een vakje. + Volgende speler + Drie-op-een-rij afsluiten? + En de winnaar is... + Er is geen winnaar in deze ronde... + diff --git a/Output/PartyModes/TicTacToe/Languages/Turkish.xml b/Output/PartyModes/TicTacToe/Languages/Turkish.xml new file mode 100644 index 00000000..9af5e420 --- /dev/null +++ b/Output/PartyModes/TicTacToe/Languages/Turkish.xml @@ -0,0 +1,34 @@ + + + Türkçe + XOX oyunu + Özel bir şekilde XOX oyna + Strateji, şans ve becerilerle eğlenceli turlar + Sonraki + Önceki + Başla + Çıkış + Evet + Hayır + Başla + Şarkılar + Takım + Çalma Listesi + Kategori + Tüm Şarkılar + XOX: Yapılandırma + 1. takımdaki oyuncu sayısı + 2. takımdaki oyuncu sayısı + Bölge sayısı + Şarkı Kaynağı + Oyun Modu + XOX: Oyuncu Seç + 1. Takım + 2. Takım + XOX + Bir bölge seç. + Sonraki oyuncu + XOX oyunundan gerçekten çıkmak istiyor musunuz? + Ve kazanan... + Bu turdan hiç kazanan çıkmadı... + diff --git a/Output/Readme.txt b/Output/Readme.txt index 4187d5a7..cd0cd6ac 100644 --- a/Output/Readme.txt +++ b/Output/Readme.txt @@ -109,39 +109,41 @@ Vocaluxe.exe -ConfigFile MyConfig.xml -ScoreFile C:\Vocaluxe\Highscores\MyHighsc ================================= = 4. Controls = ================================= -[Mouse] to navigate through the screens: Left button: select/manipulate elements, - Right button: go to previous screen. -[Cursor] to navigate through the screens. -[Enter] to confirm +[Mouse] to navigate through the screens: Left button: select/manipulate elements, + Right button: go to previous screen. +[Cursor] to navigate through the screens. +[Enter] to confirm [Escape] or [Back] to go to the previous screen. -[ALT] + [P] to take a ScreenShot. Screenshots are saved in the directory "Screenshots". +[ALT] + [P] to take a ScreenShot. Screenshots are saved in the directory "Screenshots". [ALT] + [ENTER] to toggle full screen mode. [SHIFT] + [F1] to toggle theme edit mode. The theme edit mode is experimental. It allows you to change the size and position of the element on the screens. You can save your changes with [S] before leaving the theme edit mode. -[TAB] to open the background music controls (not on all screens). +[TAB] to open the background music controls (not on all screens). [SHIFT] + [+] to increase volume [SHIFT] + [-] to decrease volume Song screen +[F3] to open/close the song search menu +[SPACE] to open/close the song menu [CTRL] + [R] to select a random song -[F3] to open/close the song search menu -[A] to sing all songs -[SHIFT] + [A] to sing all songs from a category -[SPACE] to open/close the song menu +[CTRL] + [A] to sing all songs +[CTRL] + [V] to sing all songs from a category +[NUM_1]..[NUM_6] to use a Joker for team 1..6 +[A]..[Z] to jump to category/song title starting with that letter Name selection screen -[1]..[6] to activate player selection. -[Cursor] to select a profile. -[Enter] to confirm a selection. +[1]..[6] to activate player selection. +[Cursor] to select a profile. +[Enter] to confirm a selection. Sing screen -[P] to toggle pause. +[P] to toggle pause. [CTRL] + [S] to skip a song if there is another one in the playlist. -[T] to change the time format of the timer. -[I] to change view of player information. -[W] to activate the configured webcam. +[T] to change the time format of the timer. +[I] to change view of player information. +[W] to activate the configured webcam. ================================= diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 5135f622..e279174b 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1,7 +1,7 @@  - 4 + 5 Video @@ -954,7 +954,7 @@ Button 40 - 135 + 225 -2,11 360 40 @@ -1003,7 +1003,7 @@ Button 40 - 180 + 270 -2,11 360 40 @@ -1045,14 +1045,14 @@ - + Button Button 40 - 270 + 135 -2,11 360 40 @@ -1085,7 +1085,7 @@ Outline - TR_SCREENSONG_BUTTON_OPENPLAYLIST + TR_SCREENSONG_BUTTON_OPEN_SELECTED_ITEM @@ -1093,7 +1093,7 @@ - + Invisible @@ -1449,19 +1449,19 @@ SelectSlide 40 - 225 + 180 -2,11 360 40 45 - 235 + 190 -2,12 30 30 365 - 235 + 190 -2,12 30 30 diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index 35d3c6ba..84b853fb 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -1,5 +1,13 @@ ScreenSong +++++++++++ +Version 5: + +Add: + +Remove: +ButtonOptionsOpenPlaylist + ++++++++++ Version 4: diff --git a/Output/x64/SQLite.Interop.dll b/Output/x64/SQLite.Interop.dll new file mode 100644 index 00000000..0188070e Binary files /dev/null and b/Output/x64/SQLite.Interop.dll differ diff --git a/Output/x64/SlimDX.dll b/Output/x64/SlimDX.dll index 4132e870..ca05cbd7 100644 Binary files a/Output/x64/SlimDX.dll and b/Output/x64/SlimDX.dll differ diff --git a/Output/x64/System.Data.SQLite.dll b/Output/x64/System.Data.SQLite.dll index 6f07d5e7..1ee930f1 100644 Binary files a/Output/x64/System.Data.SQLite.dll and b/Output/x64/System.Data.SQLite.dll differ diff --git a/Output/x64/acinerella.dll b/Output/x64/acinerella.dll index e851fd01..eb6998e6 100644 Binary files a/Output/x64/acinerella.dll and b/Output/x64/acinerella.dll differ diff --git a/Output/x64/avcodec-54.dll b/Output/x64/avcodec-54.dll index ca074e7c..193d96cb 100644 Binary files a/Output/x64/avcodec-54.dll and b/Output/x64/avcodec-54.dll differ diff --git a/Output/x64/avformat-54.dll b/Output/x64/avformat-54.dll index 40521b17..67041399 100644 Binary files a/Output/x64/avformat-54.dll and b/Output/x64/avformat-54.dll differ diff --git a/Output/x64/avutil-51.dll b/Output/x64/avutil-51.dll deleted file mode 100644 index 5f8cdf7d..00000000 Binary files a/Output/x64/avutil-51.dll and /dev/null differ diff --git a/Output/x64/avutil-52.dll b/Output/x64/avutil-52.dll index d1985df4..c7ca9619 100644 Binary files a/Output/x64/avutil-52.dll and b/Output/x64/avutil-52.dll differ diff --git a/Output/x64/gstreamer/GstreamerHelper.dll b/Output/x64/gstreamer/GstreamerHelper.dll deleted file mode 100644 index c647f7a1..00000000 Binary files a/Output/x64/gstreamer/GstreamerHelper.dll and /dev/null differ diff --git a/Output/x64/swresample-0.dll b/Output/x64/swresample-0.dll index f1150429..9b3af43d 100644 Binary files a/Output/x64/swresample-0.dll and b/Output/x64/swresample-0.dll differ diff --git a/Output/x64/swscale-2.dll b/Output/x64/swscale-2.dll index dcc41fd3..5d6588fe 100644 Binary files a/Output/x64/swscale-2.dll and b/Output/x64/swscale-2.dll differ diff --git a/Output/x86/SQLite.Interop.dll b/Output/x86/SQLite.Interop.dll new file mode 100644 index 00000000..89523cfb Binary files /dev/null and b/Output/x86/SQLite.Interop.dll differ diff --git a/Output/x86/SlimDX.dll b/Output/x86/SlimDX.dll index 8715ac49..c02903f6 100644 Binary files a/Output/x86/SlimDX.dll and b/Output/x86/SlimDX.dll differ diff --git a/Output/x86/System.Data.SQLite.dll b/Output/x86/System.Data.SQLite.dll index aa398bbe..1ee930f1 100644 Binary files a/Output/x86/System.Data.SQLite.dll and b/Output/x86/System.Data.SQLite.dll differ diff --git a/Output/x86/acinerella.dll b/Output/x86/acinerella.dll index a39e3501..f651542d 100644 Binary files a/Output/x86/acinerella.dll and b/Output/x86/acinerella.dll differ diff --git a/Output/x86/avcodec-54.dll b/Output/x86/avcodec-54.dll index 97d7f850..7b08c266 100644 Binary files a/Output/x86/avcodec-54.dll and b/Output/x86/avcodec-54.dll differ diff --git a/Output/x86/avformat-54.dll b/Output/x86/avformat-54.dll index 7328c561..9dc249e0 100644 Binary files a/Output/x86/avformat-54.dll and b/Output/x86/avformat-54.dll differ diff --git a/Output/x86/avutil-51.dll b/Output/x86/avutil-51.dll deleted file mode 100644 index 5ab61687..00000000 Binary files a/Output/x86/avutil-51.dll and /dev/null differ diff --git a/Output/x86/avutil-52.dll b/Output/x86/avutil-52.dll index af2ce47e..100dc0f5 100644 Binary files a/Output/x86/avutil-52.dll and b/Output/x86/avutil-52.dll differ diff --git a/Output/x86/swresample-0.dll b/Output/x86/swresample-0.dll index 060469a0..6a77631b 100644 Binary files a/Output/x86/swresample-0.dll and b/Output/x86/swresample-0.dll differ diff --git a/Output/x86/swscale-2.dll b/Output/x86/swscale-2.dll index afa902a0..f3b957f8 100644 Binary files a/Output/x86/swscale-2.dll and b/Output/x86/swscale-2.dll differ diff --git a/PartyModes/Excludes.txt b/PartyModes/Excludes.txt new file mode 100644 index 00000000..794d6f05 --- /dev/null +++ b/PartyModes/Excludes.txt @@ -0,0 +1 @@ +GlobalSuppressions.cs diff --git a/PartyModes/PartyModeChallenge/ChallengeRounds.cs b/PartyModes/PartyModeChallenge/ChallengeRounds.cs index 05670e10..908c1fa8 100644 --- a/PartyModes/PartyModeChallenge/ChallengeRounds.cs +++ b/PartyModes/PartyModeChallenge/ChallengeRounds.cs @@ -1,22 +1,19 @@ using System; using System.Collections.Generic; -using System.Text; -using Vocaluxe.Menu; - -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes.Challenge { public class ChallengeRounds { - private Random _Rand; - private int _NumPlayer; + private readonly Random _Rand; + private readonly int _NumPlayer; public List Rounds; public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce) { Rounds = new List(); - _Rand = new Random(System.DateTime.Now.Millisecond); + _Rand = new Random(DateTime.Now.Millisecond); if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0) _NumPlayer = 0; @@ -41,26 +38,19 @@ namespace Vocaluxe.PartyModes Rounds.Add(Combinations.GetNextCombination(null)); for (int i = 1; i < NumRounds; i++) - { - Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(i))); - } } private List GetPlayerDemand(int RoundIndex) { List NumPlayed = new List(_NumPlayer); for (int i = 0; i < _NumPlayer; i++) - { NumPlayed.Add(0); - } for (int i = 0; i < RoundIndex; i++) { foreach (int PlayerIndex in Rounds[i].Player) - { NumPlayed[PlayerIndex]++; - } } int max = 0; @@ -95,7 +85,6 @@ namespace Vocaluxe.PartyModes } else last.Add(i); - } } @@ -129,17 +118,17 @@ namespace Vocaluxe.PartyModes class Combinations { - private List _Combs; - private Random _Rand; - private int _NumPlayer; - private int _NumMics; + private readonly List _Combs; + private readonly Random _Rand; + private readonly int _NumPlayer; + private readonly int _NumMics; public Combinations(int NumPlayer, int NumMics, Random Rand) { _Combs = new List(); _NumMics = NumMics; _NumPlayer = NumPlayer; - _Rand = Rand; + _Rand = Rand; } public Combination GetNextCombination(List PlayerNrDemand) @@ -150,9 +139,7 @@ namespace Vocaluxe.PartyModes Combination combs = new Combination(); if (_NumPlayer == _NumMics) - { return _Combs[0]; - } //filter against PlayerNrDemand List combsFiltered = new List(); @@ -179,18 +166,14 @@ namespace Vocaluxe.PartyModes if (combsFiltered.Count == 0) { for (int i = 0; i < _Combs.Count; i++) - { combsFiltered.Add(_Combs[i]); - } } int num = combsFiltered.Count; int rand = _Rand.Next(num); Combination c = new Combination(); for (int i = 0; i < combsFiltered[rand].Player.Count; i++) - { c.Player.Add(combsFiltered[rand].Player[i]); - } _Combs.Remove(combsFiltered[rand]); return combsFiltered[rand]; @@ -209,9 +192,7 @@ namespace Vocaluxe.PartyModes for (int j = 0; j < _NumPlayer; j++) { if ((i & (1 << j)) > 0) - { c.Player.Add(j); - } } if (c.Player.Count == _NumMics) @@ -243,9 +224,7 @@ namespace Vocaluxe.PartyModes { bool result = true; foreach (int p in PlayerIndices) - { result &= IsAvailable(p); - } return result; } @@ -253,10 +232,8 @@ namespace Vocaluxe.PartyModes { bool result = false; foreach (int p in PlayerIndices) - { result |= IsAvailable(p); - } return result; } } -} +} \ No newline at end of file diff --git a/PartyModes/PartyModeChallenge/GlobalSuppressions.cs b/PartyModes/PartyModeChallenge/GlobalSuppressions.cs new file mode 100644 index 00000000..21fb9bcd Binary files /dev/null and b/PartyModes/PartyModeChallenge/GlobalSuppressions.cs differ diff --git a/PartyModes/PartyModeChallenge/PartyModeChallenge.cs b/PartyModes/PartyModeChallenge/PartyModeChallenge.cs index 600024c2..2b248af1 100644 --- a/PartyModes/PartyModeChallenge/PartyModeChallenge.cs +++ b/PartyModes/PartyModeChallenge/PartyModeChallenge.cs @@ -1,12 +1,15 @@ using System; using System.Collections.Generic; -using System.Text; +using System.Runtime.InteropServices; +using VocaluxeLib.Menu; -using Vocaluxe.Menu; +[assembly: ComVisible(false)] -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes.Challenge { + #region Communication + #region ToScreen public struct DataToScreenConfig { @@ -52,9 +55,7 @@ namespace Vocaluxe.PartyModes { res = row.NumSingPoints.CompareTo(NumSingPoints); if (res == 0) - { res = row.NumWon.CompareTo(NumWon); - } } return res; } @@ -62,7 +63,6 @@ namespace Vocaluxe.PartyModes throw new ArgumentException("object is not a ResultTableRow"); } } - #endregion ToScreen #region FromScreen @@ -93,6 +93,7 @@ namespace Vocaluxe.PartyModes public bool FadeToNameSelection; } #endregion FromScreen + #endregion Communication public sealed class PartyModeChallenge : CPartyMode @@ -103,7 +104,7 @@ namespace Vocaluxe.PartyModes private const int MinTeams = 0; private const int MaxNumRounds = 100; - enum EStage + private enum EStage { NotStarted, Config, @@ -112,7 +113,7 @@ namespace Vocaluxe.PartyModes Singing } - struct Data + private struct Data { public int NumPlayer; public int NumPlayerAtOnce; @@ -128,7 +129,7 @@ namespace Vocaluxe.PartyModes public int[] CatSongIndices; } - struct Stats + private struct Stats { public int ProfileID; public int SingPoints; @@ -148,13 +149,13 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Selection.RandomOnly = false; _ScreenSongOptions.Selection.PartyMode = true; _ScreenSongOptions.Selection.CategoryChangeAllowed = true; - _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 }; - _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" }; + _ScreenSongOptions.Selection.NumJokers = new int[] {5, 5}; + _ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"}; _ScreenSongOptions.Sorting.SearchString = String.Empty; _ScreenSongOptions.Sorting.SearchActive = false; - _ScreenSongOptions.Sorting.ShowDuetSongs = false; - + _ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.NoDuets; + _Stage = EStage.NotStarted; ToScreenConfig = new DataToScreenConfig(); @@ -195,7 +196,7 @@ namespace Vocaluxe.PartyModes switch (ScreenName) { case "PartyScreenChallengeConfig": - + try { data = (DataFromScreen)Data; @@ -327,10 +328,8 @@ namespace Vocaluxe.PartyModes Screen.DataToScreen(ToScreenMain); } break; - default: - break; } - + return Screen; } @@ -441,7 +440,6 @@ namespace Vocaluxe.PartyModes public override void SongSelected(int SongID) { - EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; CBase.Game.Reset(); @@ -503,30 +501,30 @@ namespace Vocaluxe.PartyModes switch (GameData.NumPlayerAtOnce) { case 1: - _ScreenSongOptions.Selection.NumJokers = new int[] { 10 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {10}; break; case 2: - _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {5, 5}; break; case 3: - _ScreenSongOptions.Selection.NumJokers = new int[] { 4, 4, 4 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {4, 4, 4}; break; case 4: - _ScreenSongOptions.Selection.NumJokers = new int[] { 3, 3, 3, 3 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {3, 3, 3, 3}; break; case 5: - _ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {2, 2, 2, 2, 2}; break; case 6: - _ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2, 2 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {2, 2, 2, 2, 2, 2}; break; default: - _ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 }; + _ScreenSongOptions.Selection.NumJokers = new int[] {5, 5}; break; } } @@ -537,16 +535,16 @@ namespace Vocaluxe.PartyModes if (profiles == null) { - _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" }; + _ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"}; return; } if (GameData.NumPlayerAtOnce < 1 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce) { - _ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" }; + _ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"}; return; } - + _ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce]; Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1); @@ -580,13 +578,11 @@ namespace Vocaluxe.PartyModes GameData.ResultTable.Add(row); } - GameData.Results = new int[GameData.NumRounds, GameData.NumPlayerAtOnce]; + GameData.Results = new int[GameData.NumRounds,GameData.NumPlayerAtOnce]; for (int i = 0; i < GameData.NumRounds; i++) { for (int j = 0; j < GameData.NumPlayerAtOnce; j++) - { GameData.Results[i, j] = 0; - } } } else @@ -599,9 +595,7 @@ namespace Vocaluxe.PartyModes return; for (int j = 0; j < GameData.NumPlayerAtOnce; j++) - { GameData.Results[GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points); - } List points = GetPointsForPlayer(results); @@ -609,13 +603,13 @@ namespace Vocaluxe.PartyModes { int index = -1; for (int j = 0; j < GameData.ResultTable.Count; j++) - { + { if (points[i].ProfileID == GameData.ResultTable[j].PlayerID) { index = j; break; } - } + } if (index != -1) { @@ -638,7 +632,7 @@ namespace Vocaluxe.PartyModes int pos = 1; int lastPoints = 0; int lastSingPoints = 0; - for (int i = 0; i < GameData.ResultTable.Count; i++ ) + for (int i = 0; i < GameData.ResultTable.Count; i++) { if (lastPoints > GameData.ResultTable[i].NumGamePoints || lastSingPoints > GameData.ResultTable[i].NumSingPoints) pos++; @@ -651,7 +645,7 @@ namespace Vocaluxe.PartyModes private List GetPointsForPlayer(SPlayer[] Results) { List result = new List(); - for(int i = 0; i < GameData.NumPlayerAtOnce; i++) + for (int i = 0; i < GameData.NumPlayerAtOnce; i++) { Stats stat = new Stats(); stat.ProfileID = Results[i].ProfileID; @@ -698,7 +692,6 @@ namespace Vocaluxe.PartyModes } - return result; } @@ -708,11 +701,9 @@ namespace Vocaluxe.PartyModes { GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()]; for (int i = 0; i < GameData.CatSongIndices.Length; i++) - { GameData.CatSongIndices[i] = -1; - } } - + if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF) GameData.CatSongIndices = null; } diff --git a/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj index 37fb7251..725cc119 100644 --- a/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj +++ b/PartyModes/PartyModeChallenge/PartyModeChallenge.csproj @@ -8,11 +8,10 @@ {5A4053F1-5AD5-441F-B254-D97A088127B6} Library Properties - PartyModeChallenge - PartyModeChallenge - v2.0 - - + VocaluxeLib.PartyModes.Challenge + Challenge + v4.0 + Client 512 @@ -20,7 +19,7 @@ true full false - ..\..\Output\PartyModes\Challenge\Code + bin TRACE;DEBUG;WIN prompt 4 @@ -30,7 +29,7 @@ AnyCPU none true - ..\..\Output\PartyModes\Challenge\Code + bin prompt 4 false @@ -42,17 +41,18 @@ true full false - ..\..\Output\PartyModes\Challenge\Code + bin TRACE;DEBUG;WIN prompt 4 Off + ..\..\CheckingRules.ruleset AnyCPU none true - ..\..\Output\PartyModes\Challenge\Code + bin prompt 4 false @@ -64,7 +64,7 @@ true full false - ..\..\Output\PartyModes\Challenge\Code + bin TRACE;DEBUG;LINUX prompt 4 @@ -74,7 +74,7 @@ AnyCPU none true - ..\..\Output\PartyModes\Challenge\Code + bin prompt 4 false @@ -86,7 +86,7 @@ true full false - ..\..\Output\PartyModes\Challenge\Code + bin TRACE;DEBUG;LINUX prompt 4 @@ -96,7 +96,7 @@ AnyCPU none true - ..\..\Output\PartyModes\Challenge\Code + bin prompt 4 false @@ -107,21 +107,12 @@ - - Always - - - Always - - - Always - - - Always - - - Always - + + + + + + @@ -137,7 +128,14 @@ + + + + + cd $(SolutionDir)Partymodes\ +xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y + Use factory method LoadSong - private CSong() - { - } + private CSong() {} public static CSong LoadSong(string FilePath) { @@ -245,81 +237,73 @@ namespace Vocaluxe.Menu.SongMenu public CSong(CSong song) { - this._CoverTextureSmall = song._CoverTextureSmall; - this._CoverTextureBig = song._CoverTextureBig; + _CoverTextureSmall = song._CoverTextureSmall; + _CoverTextureBig = song._CoverTextureBig; - this.Medley = new SMedley(); - this.Medley.Source = song.Medley.Source; - this.Medley.StartBeat = song.Medley.StartBeat; - this.Medley.EndBeat = song.Medley.EndBeat; - this.Medley.FadeInTime = song.Medley.FadeInTime; - this.Medley.FadeOutTime = song.Medley.FadeOutTime; + Medley = new SMedley(); + Medley.Source = song.Medley.Source; + Medley.StartBeat = song.Medley.StartBeat; + Medley.EndBeat = song.Medley.EndBeat; + Medley.FadeInTime = song.Medley.FadeInTime; + Medley.FadeOutTime = song.Medley.FadeOutTime; - this.CalculateMedley = song.CalculateMedley; - this.PreviewStart = song.PreviewStart; + CalculateMedley = song.CalculateMedley; + PreviewStart = song.PreviewStart; - this.ShortEnd = song.ShortEnd; - this.DuetPart1 = song.DuetPart1; - this.DuetPart2 = song.DuetPart2; + ShortEnd = song.ShortEnd; + DuetPart1 = song.DuetPart1; + DuetPart2 = song.DuetPart2; - this.Encoding = song.Encoding; - this.Folder = song.Folder; - this.FolderName = song.FolderName; - this.FileName = song.FileName; - this.Relative = song.Relative; + Encoding = song.Encoding; + Folder = song.Folder; + FolderName = song.FolderName; + FileName = song.FileName; + Relative = song.Relative; - this.MP3FileName = song.MP3FileName; - this.CoverFileName = song.CoverFileName; - this.BackgroundFileName = song.BackgroundFileName; - this.VideoFileName = song.VideoFileName; + MP3FileName = song.MP3FileName; + CoverFileName = song.CoverFileName; + BackgroundFileName = song.BackgroundFileName; + VideoFileName = song.VideoFileName; - this.VideoAspect = song.VideoAspect; - this._CoverSmallLoaded = song._CoverSmallLoaded; - this._CoverBigLoaded = song._CoverBigLoaded; - this._NotesLoaded = song._NotesLoaded; + VideoAspect = song.VideoAspect; + _CoverSmallLoaded = song._CoverSmallLoaded; + _CoverBigLoaded = song._CoverBigLoaded; + _NotesLoaded = song._NotesLoaded; - this.Artist = song.Artist; - this.Title = song.Title; - - this.Start = song.Start; - this.Finish = song.Finish; + Artist = song.Artist; + Title = song.Title; - this.BPM = song.BPM; - this.Gap = song.Gap; - this.VideoGap = song.VideoGap; + Start = song.Start; + Finish = song.Finish; - this.Comment = new List(); + BPM = song.BPM; + Gap = song.Gap; + VideoGap = song.VideoGap; + + Comment = new List(); foreach (string value in song.Comment) - { - this.Comment.Add(value); - } + Comment.Add(value); - this.ID = song.ID; - this.Visible = song.Visible; - this.CatIndex = song.CatIndex; - this.Selected = song.Selected; + ID = song.ID; + Visible = song.Visible; + CatIndex = song.CatIndex; + Selected = song.Selected; - this.Edition = new List(); + Edition = new List(); foreach (string value in song.Edition) - { - this.Edition.Add(value); - } + Edition.Add(value); - this.Genre = new List(); + Genre = new List(); foreach (string value in song.Genre) - { - this.Genre.Add(value); - } + Genre.Add(value); - this.Year = song.Year; + Year = song.Year; - this.Language = new List(); + Language = new List(); foreach (string value in song.Language) - { - this.Language.Add(value); - } + Language.Add(value); - this.Notes = new CNotes(song.Notes); + Notes = new CNotes(song.Notes); } public string GetMP3() @@ -337,33 +321,32 @@ namespace Vocaluxe.Menu.SongMenu if (!File.Exists(FilePath)) return false; - this.Folder = Path.GetDirectoryName(FilePath); + Folder = Path.GetDirectoryName(FilePath); foreach (string folder in CBase.Config.GetSongFolder()) { - if (this.Folder.Contains(folder)) + if (Folder.Contains(folder)) { - if (this.Folder.Length == folder.Length) - this.FolderName = "Songs"; + if (Folder.Length == folder.Length) + FolderName = "Songs"; else { - this.FolderName = this.Folder.Substring(folder.Length + 1, this.Folder.Length - folder.Length - 1); + FolderName = Folder.Substring(folder.Length + 1, Folder.Length - folder.Length - 1); - int pos = this.FolderName.IndexOf("\\"); + int pos = FolderName.IndexOf("\\"); if (pos >= 0) - this.FolderName = this.FolderName.Substring(0, pos); + FolderName = FolderName.Substring(0, pos); } break; } } - this.FileName = Path.GetFileName(FilePath); + FileName = Path.GetFileName(FilePath); EHeaderFlags HeaderFlags = new EHeaderFlags(); - StreamReader sr; + StreamReader sr = null; try { - sr = new StreamReader(FilePath, Encoding.Default, true); string line; @@ -377,7 +360,8 @@ namespace Vocaluxe.Menu.SongMenu line = sr.ReadLine(); if (line.Length == 0) continue; - if (!line[0].ToString().Equals("#")) break; + if (!line[0].ToString().Equals("#")) + break; pos = line.IndexOf(":"); @@ -391,17 +375,20 @@ namespace Vocaluxe.Menu.SongMenu switch (Identifier) { case "ENCODING": - this.Encoding = CEncoding.GetEncoding(Value); - sr = new StreamReader(FilePath, this.Encoding); + Encoding = CEncoding.GetEncoding(Value); + sr.Dispose(); + sr = null; + sr = new StreamReader(FilePath, Encoding); Identifier = String.Empty; //Scip everything till encoding while (!sr.EndOfStream) { line = sr.ReadLine(); - if (line.Length == 0) + if (line.Length == 0) continue; - if(!line[0].ToString().Equals("#")) break; + if (!line[0].ToString().Equals("#")) + break; pos = line.IndexOf(":"); @@ -414,138 +401,130 @@ namespace Vocaluxe.Menu.SongMenu } break; case "TITLE": - if (Value != String.Empty) + if (Value.Length > 0) { - this.Title = Value; + Title = Value; HeaderFlags |= EHeaderFlags.Title; } break; case "ARTIST": - if (Value != String.Empty) + if (Value.Length > 0) { - this.Artist = Value; + Artist = Value; HeaderFlags |= EHeaderFlags.Artist; } break; case "TITLE-ON-SORTING": - if (Value != String.Empty) - { - this.TitleSorting = Value; - } + if (Value.Length > 0) + TitleSorting = Value; break; case "ARTIST-ON-SORTING": - if (Value != String.Empty) - { - this.ArtistSorting = Value; - } + if (Value.Length > 0) + ArtistSorting = Value; break; case "P1": - if (Value != String.Empty) - { - this.DuetPart1 = Value; - } + if (Value.Length > 0) + DuetPart1 = Value; break; case "P2": - if (Value != String.Empty) - { - this.DuetPart2 = Value; - } + if (Value.Length > 0) + DuetPart2 = Value; break; case "MP3": - if (File.Exists(Path.Combine(this.Folder, Value))) + if (File.Exists(Path.Combine(Folder, Value))) { - this.MP3FileName = Value; + MP3FileName = Value; HeaderFlags |= EHeaderFlags.MP3; } else { - CBase.Log.LogError("Can't find audio file: " + Path.Combine(this.Folder, Value)); + CBase.Log.LogError("Can't find audio file: " + Path.Combine(Folder, Value)); return false; } break; case "BPM": - if (CHelper.TryParse(Value, out this.BPM)) + if (CHelper.TryParse(Value, out BPM)) { - this.BPM *= 4; + BPM *= 4; HeaderFlags |= EHeaderFlags.BPM; } break; case "EDITION": if (Value.Length > 1) - this.Edition.Add(Value); + Edition.Add(Value); break; case "GENRE": if (Value.Length > 1) - this.Genre.Add(Value); + Genre.Add(Value); break; case "YEAR": int num = 0; if (Value.Length == 4 && int.TryParse(Value, out num) && num != 0) - { - this.Year = Value; - } + Year = Value; break; case "LANGUAGE": if (Value.Length > 1) - this.Language.Add(Value); + Language.Add(Value); break; case "COMMENT": if (Value.Length > 1) - this.Comment.Add(Value); + Comment.Add(Value); break; case "GAP": - if (CHelper.TryParse(Value, out this.Gap)) - this.Gap /= 1000f; + if (CHelper.TryParse(Value, out Gap)) + Gap /= 1000f; break; case "COVER": - if (File.Exists(Path.Combine(this.Folder, Value))) - this.CoverFileName = Value; + if (File.Exists(Path.Combine(Folder, Value))) + CoverFileName = Value; break; case "BACKGROUND": - if (File.Exists(Path.Combine(this.Folder, Value))) - this.BackgroundFileName = Value; + if (File.Exists(Path.Combine(Folder, Value))) + BackgroundFileName = Value; break; case "VIDEO": - if (File.Exists(Path.Combine(this.Folder, Value))) - this.VideoFileName = Value; + if (File.Exists(Path.Combine(Folder, Value))) + VideoFileName = Value; else - CBase.Log.LogError("Can't find video file: " + Path.Combine(this.Folder, Value)); + CBase.Log.LogError("Can't find video file: " + Path.Combine(Folder, Value)); break; case "VIDEOGAP": - CHelper.TryParse(Value, out this.VideoGap); + CHelper.TryParse(Value, out VideoGap); break; case "VIDEOASPECT": - CHelper.TryParse(Value, out this.VideoAspect, true); + CHelper.TryParse(Value, out VideoAspect, true); break; case "START": - CHelper.TryParse(Value, out this.Start); + CHelper.TryParse(Value, out Start); break; case "END": - if (CHelper.TryParse(Value, out this.Finish)) - this.Finish /= 1000f; + if (CHelper.TryParse(Value, out Finish)) + Finish /= 1000f; break; case "PREVIEWSTART": - if (CHelper.TryParse(Value, out this.PreviewStart)) - if (this.PreviewStart < 0f) - this.PreviewStart = 0f; + if (CHelper.TryParse(Value, out PreviewStart)) + { + if (PreviewStart < 0f) + PreviewStart = 0f; else HeaderFlags |= EHeaderFlags.PreviewStart; + } break; case "MEDLEYSTARTBEAT": - if (int.TryParse(Value, out this.Medley.StartBeat)) + if (int.TryParse(Value, out Medley.StartBeat)) HeaderFlags |= EHeaderFlags.MedleyStartBeat; break; case "MEDLEYENDBEAT": - if (int.TryParse(Value, out this.Medley.EndBeat)) + if (int.TryParse(Value, out Medley.EndBeat)) HeaderFlags |= EHeaderFlags.MedleyEndBeat; break; case "CALCMEDLEY": if (Value.ToUpper() == "OFF") - this.CalculateMedley = false; + CalculateMedley = false; break; case "RELATIVE": if (Value.ToUpper() == "YES" && Value.ToUpper() != "NO") - this.Relative = EOffOn.TR_CONFIG_ON; + Relative = EOffOn.TR_CONFIG_ON; break; } } @@ -586,61 +565,60 @@ namespace Vocaluxe.Menu.SongMenu #region check medley tags if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0) { - if (this.Medley.StartBeat > this.Medley.EndBeat) + if (Medley.StartBeat > Medley.EndBeat) { CBase.Log.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath); HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat; } } - if ((HeaderFlags & EHeaderFlags.PreviewStart) == 0 || this.PreviewStart == 0f) + if ((HeaderFlags & EHeaderFlags.PreviewStart) == 0 || PreviewStart == 0f) { //PreviewStart is not set or <=0 if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0) //fallback to MedleyStart - this.PreviewStart = CBase.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM); + PreviewStart = CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM); else //else set to 0, it will be set in FindRefrainStart - this.PreviewStart = 0f; + PreviewStart = 0f; } if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0) { - this.Medley.Source = EMedleySource.Tag; - this.Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime(); - this.Medley.FadeOutTime = CBase.Settings.GetDefaultMedleyFadeOutTime(); + Medley.Source = EMedleySource.Tag; + Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime(); + Medley.FadeOutTime = CBase.Settings.GetDefaultMedleyFadeOutTime(); } #endregion check medley tags - this.Encoding = sr.CurrentEncoding; + Encoding = sr.CurrentEncoding; } catch (Exception e) { + if (sr != null) + sr.Dispose(); CBase.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message); return false; } - + sr.Dispose(); CheckFiles(); //Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag. - if (this.ArtistSorting == String.Empty) - { - this.ArtistSorting = this.Artist; - } + if (ArtistSorting.Length == 0) + ArtistSorting = Artist; - if (this.TitleSorting == String.Empty) - { - this.TitleSorting = this.Title; - } + if (TitleSorting.Length == 0) + TitleSorting = Title; return true; } public bool ReadNotes() { - return ReadNotes(Path.Combine(this.Folder, this.FileName)); + return ReadNotes(Path.Combine(Folder, FileName)); } - public bool ReadNotes(string FilePath, bool forceReload=false) + + public bool ReadNotes(string FilePath, bool forceReload = false) { //Skip loading if already done and no reload is forced if (_NotesLoaded && !forceReload) @@ -664,22 +642,21 @@ namespace Vocaluxe.Menu.SongMenu int Player = 0; int FileLineNo = 0; - StreamReader sr; + StreamReader sr = null; try { + sr = new StreamReader(FilePath, Encoding, true); - sr = new StreamReader(FilePath, this.Encoding, true); - - this.Notes.Reset(); + Notes.Reset(); //Search for Note Beginning - while(!sr.EndOfStream) + while (!sr.EndOfStream) { line = sr.ReadLine(); FileLineNo++; TempC = (char)sr.Peek(); - if ((TempC == '#') || (TempC == '\r') || (TempC == '\n')) + if ((TempC == '#') || (TempC == '\r') || (TempC == '\n')) continue; if ((TempC == ':') || (TempC == 'F') || (TempC == '*') || (TempC == 'P')) { @@ -696,12 +673,11 @@ namespace Vocaluxe.Menu.SongMenu do { - char chr; switch (TempC) { case 'P': - while ((chr = (char)sr.Read()) == ' ') { } + while ((chr = (char)sr.Read()) == ' ') {} int.TryParse(chr.ToString(), out Param1); if (Param1 == 1) @@ -741,7 +717,7 @@ namespace Vocaluxe.Menu.SongMenu else NoteType = ENoteType.Normal; - if (this.Relative == EOffOn.TR_CONFIG_ON) + if (Relative == EOffOn.TR_CONFIG_ON) Param1 += currentPos; if (Player != 2) @@ -764,7 +740,7 @@ namespace Vocaluxe.Menu.SongMenu sr.Read(); Param1 = CHelper.TryReadInt(sr); - if (this.Relative == EOffOn.TR_CONFIG_ON) + if (Relative == EOffOn.TR_CONFIG_ON) { Param1 += currentPos; sr.Read(); @@ -796,22 +772,23 @@ namespace Vocaluxe.Menu.SongMenu } while (!sr.EndOfStream && (c == 19 || c == 16 || c == 13 || c == 10)); TempC = (char)c; FileLineNo++; - }while(!sr.EndOfStream && (TempC != 'E')); + } while (!sr.EndOfStream && (TempC != 'E')); - foreach(CLines lines in this.Notes.Lines) - { + foreach (CLines lines in Notes.Lines) lines.UpdateTimings(); - } } catch (Exception e) { CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath); + if (sr != null) + sr.Dispose(); return false; } + sr.Dispose(); FindRefrain(); FindShortEnd(); _NotesLoaded = true; - if(IsDuet) + if (IsDuet) CheckDuet(); return true; } @@ -819,7 +796,7 @@ namespace Vocaluxe.Menu.SongMenu private bool ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text) { CNote note = new CNote(Start, Length, Tone, Text, NoteType); - CLines lines = this.Notes.GetLines(Player); + CLines lines = Notes.GetLines(Player); return lines.AddNote(note); } @@ -828,16 +805,16 @@ namespace Vocaluxe.Menu.SongMenu CLines lines = Notes.GetLines(Player); CLine line = new CLine(); line.StartBeat = Start; - lines.AddLine(line); + lines.AddLine(line); } public void LoadSmallCover() { if (_CoverSmallLoaded) return; - if (this.CoverFileName != String.Empty) + if (CoverFileName.Length > 0) { - if (!CBase.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize())) + if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize())) _CoverTextureSmall = CBase.Cover.GetNoCover(); } else @@ -848,44 +825,42 @@ namespace Vocaluxe.Menu.SongMenu private void CheckFiles() { - if(this.CoverFileName == String.Empty){ - List files = CHelper.ListFiles(this.Folder, "*.jpg", false); - files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false)); - foreach(String file in files) + if (CoverFileName.Length == 0) + { + List files = CHelper.ListFiles(Folder, "*.jpg", false); + files.AddRange(CHelper.ListFiles(Folder, "*.png", false)); + foreach (String file in files) { - if (Regex.IsMatch(file, @".[CO].", RegexOptions.IgnoreCase) && (Regex.IsMatch(file, @"" + Regex.Escape(this.Title), RegexOptions.IgnoreCase) || Regex.IsMatch(file, @"" + Regex.Escape(this.Artist), RegexOptions.IgnoreCase))) - { - this.CoverFileName = file; - } + if (Regex.IsMatch(file, @".[CO].", RegexOptions.IgnoreCase) && + (Regex.IsMatch(file, @"" + Regex.Escape(Title), RegexOptions.IgnoreCase) || Regex.IsMatch(file, @"" + Regex.Escape(Artist), RegexOptions.IgnoreCase))) + CoverFileName = file; } } - if (this.BackgroundFileName == String.Empty) + if (BackgroundFileName.Length == 0) { - List files = CHelper.ListFiles(this.Folder, "*.jpg", false); - files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false)); + List files = CHelper.ListFiles(Folder, "*.jpg", false); + files.AddRange(CHelper.ListFiles(Folder, "*.png", false)); foreach (String file in files) { - - if (Regex.IsMatch(file, @".[BG].", RegexOptions.IgnoreCase) && (Regex.IsMatch(file, @"" + Regex.Escape(this.Title), RegexOptions.IgnoreCase) || Regex.IsMatch(file, @"" + Regex.Escape(this.Artist), RegexOptions.IgnoreCase))) - { - this.BackgroundFileName = file; - } + if (Regex.IsMatch(file, @".[BG].", RegexOptions.IgnoreCase) && + (Regex.IsMatch(file, @"" + Regex.Escape(Title), RegexOptions.IgnoreCase) || Regex.IsMatch(file, @"" + Regex.Escape(Artist), RegexOptions.IgnoreCase))) + BackgroundFileName = file; } } } private void CheckDuet() { - if (DuetPart1 == String.Empty) + if (DuetPart1.Length == 0) { DuetPart1 = "Part 1"; - CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + Artist + " - " + Title + "\"."); } - if (DuetPart2 == String.Empty) + if (DuetPart2.Length == 0) { DuetPart2 = "Part 2"; - CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + Artist + " - " + Title + "\"."); } } @@ -898,7 +873,7 @@ namespace Vocaluxe.Menu.SongMenu private List GetSeries() { - CLines lines = this.Notes.GetLines(0); + CLines lines = Notes.GetLines(0); if (lines.LineCount == 0) return null; @@ -919,7 +894,7 @@ namespace Vocaluxe.Menu.SongMenu { for (int j = i + 1; j < lines.LineCount; j++) { - if (sentences[i] == sentences[j] && sentences[i] != String.Empty) + if (sentences[i] == sentences[j] && sentences[i].Length > 0) { Series tempSeries = new Series(); tempSeries.start = i; @@ -933,7 +908,7 @@ namespace Vocaluxe.Menu.SongMenu for (int k = 1; k <= max; k++) { - if (sentences[i + k] == sentences[j + k] && sentences[i + k] != String.Empty) + if (sentences[i + k] == sentences[j + k] && sentences[i + k].Length > 0) tempSeries.end = i + k; else break; @@ -949,16 +924,16 @@ namespace Vocaluxe.Menu.SongMenu private void FindRefrain() { - if (this.IsDuet) + if (IsDuet) { - this.Medley.Source = EMedleySource.None; + Medley.Source = EMedleySource.None; return; } - if (this.Medley.Source == EMedleySource.Tag) + if (Medley.Source == EMedleySource.Tag) return; - if (!this.CalculateMedley) + if (!CalculateMedley) return; List series = GetSeries(); @@ -973,55 +948,56 @@ namespace Vocaluxe.Menu.SongMenu longest = i; } - CLines lines = this.Notes.GetLines(0); + CLines lines = Notes.GetLines(0); // set medley vars if (series.Count > 0 && series[longest].length > CBase.Settings.GetMedleyMinSeriesLength()) { - this.Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat; - this.Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat; + Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat; + Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat; bool foundEnd = false; - + // set end if duration > MedleyMinDuration - if (CBase.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CBase.Settings.GetMedleyMinDuration() > - CBase.Game.GetTimeFromBeats(this.Medley.EndBeat, this.BPM)) + if (CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM) + CBase.Settings.GetMedleyMinDuration() > + CBase.Game.GetTimeFromBeats(Medley.EndBeat, BPM)) foundEnd = true; if (!foundEnd) { for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++) { - if (CBase.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CBase.Settings.GetMedleyMinDuration() > - CBase.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM)) + if (CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM) + CBase.Settings.GetMedleyMinDuration() > + CBase.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, BPM)) { foundEnd = true; - this.Medley.EndBeat = lines.Line[i].LastNoteBeat; + Medley.EndBeat = lines.Line[i].LastNoteBeat; } } } if (foundEnd) { - this.Medley.Source = EMedleySource.Calculated; - this.Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime(); - this.Medley.FadeOutTime = CBase.Settings.GetDefaultMedleyFadeOutTime(); + Medley.Source = EMedleySource.Calculated; + Medley.FadeInTime = CBase.Settings.GetDefaultMedleyFadeInTime(); + Medley.FadeOutTime = CBase.Settings.GetDefaultMedleyFadeOutTime(); } } - - if (this.PreviewStart == 0f) + + if (PreviewStart == 0f) { - if (this.Medley.Source == EMedleySource.Calculated) - this.PreviewStart = CBase.Game.GetTimeFromBeats(this.Medley.StartBeat, this.BPM); + if (Medley.Source == EMedleySource.Calculated) + PreviewStart = CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM); } } - private void FindShortEnd(){ + private void FindShortEnd() + { List series = GetSeries(); if (series == null) return; - CLines lines = this.Notes.GetLines(0); + CLines lines = Notes.GetLines(0); //Calculate length of singing int stop = (lines.Line[lines.Line.Length - 1].LastNoteBeat - lines.Line[0].FirstNoteBeat) / 2 + lines.Line[0].StartBeat; @@ -1033,12 +1009,12 @@ namespace Vocaluxe.Menu.SongMenu { if (stop < (lines.Line[series[i].start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].start].FirstNoteBeat) / 2))) { - this.ShortEnd = lines.Line[series[i].start-1].LastNote.EndBeat; + ShortEnd = lines.Line[series[i].start - 1].LastNote.EndBeat; return; } else { - this.ShortEnd = lines.Line[series[i].end].LastNote.EndBeat; + ShortEnd = lines.Line[series[i].end].LastNote.EndBeat; return; } } @@ -1049,18 +1025,17 @@ namespace Vocaluxe.Menu.SongMenu { if (lines.Line[i].FirstNoteBeat < stop && lines.Line[i].LastNoteBeat > stop) { - this.ShortEnd = lines.Line[i].LastNoteBeat; + ShortEnd = lines.Line[i].LastNoteBeat; return; } } ShortEnd = stop; - } public object Clone() { - return base.MemberwiseClone(); + return MemberwiseClone(); } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs index 32b2d5fa..9742e62f 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs @@ -1,16 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; +using System.Xml; +using VocaluxeLib.PartyModes; -using Vocaluxe.Menu; -using Vocaluxe.PartyModes; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { public class CSongMenu : ISongMenu { - private int _PartyModeID; + private readonly int _PartyModeID; private ISongMenu _SongMenu; private ESongMenu _Type; @@ -115,6 +110,11 @@ namespace Vocaluxe.Menu.SongMenu _SongMenu.SetSelectedCategory(CategoryNr); } + public bool EnterCurrentCategory() + { + return _SongMenu.EnterCurrentCategory(); + } + public int GetActualSelection() { return _SongMenu.GetActualSelection(); @@ -154,7 +154,6 @@ namespace Vocaluxe.Menu.SongMenu { _SongMenu.SetSmallView(SmallView); } - #endregion ISongMenu #region IMenuElement @@ -202,30 +201,27 @@ namespace Vocaluxe.Menu.SongMenu private void CreateSongMenu() { if (_SongMenu != null) - { _SongMenu.OnHide(); - } switch (CBase.Config.GetSongMenuType()) { - //case ESongMenu.TR_CONFIG_LIST: - // _SongMenu = new CSongMenuList(); - // break; - - //case ESongMenu.TR_CONFIG_DREIDEL: - // _SongMenu = new CSongMenuDreidel(); - // break; + //case ESongMenu.TR_CONFIG_LIST: + // _SongMenu = new CSongMenuList(); + // break; + //case ESongMenu.TR_CONFIG_DREIDEL: + // _SongMenu = new CSongMenuDreidel(); + // break; case ESongMenu.TR_CONFIG_TILE_BOARD: _SongMenu = new CSongMenuTileBoard(_PartyModeID); break; - //case ESongMenu.TR_CONFIG_BOOK: - // _SongMenu = new CSongMenuBook(); - // break; + //case ESongMenu.TR_CONFIG_BOOK: + // _SongMenu = new CSongMenuBook(); + // break; } _Type = CBase.Config.GetSongMenuType(); } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuBook.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuBook.cs index ac8d3dbc..abba0394 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuBook.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuBook.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { class CSongMenuBook : CSongMenuFramework { public CSongMenuBook(int PartyModeID) - : base(PartyModeID) - { - } + : base(PartyModeID) {} } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuDreidel.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuDreidel.cs index 5a031652..27898f75 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuDreidel.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuDreidel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { class CSongMenuDreidel : CSongMenuFramework { @@ -27,11 +21,8 @@ namespace Vocaluxe.Menu.SongMenu return _actualSelection; } */ - public CSongMenuDreidel(int PartyModeID) - : base(PartyModeID) - { - } + : base(PartyModeID) {} public override void Init() { @@ -48,4 +39,4 @@ namespace Vocaluxe.Menu.SongMenu **/ } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index 3c8290bf..12f0f348 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -1,18 +1,16 @@ using System; -using System.Diagnostics; using System.Collections.Generic; +using System.Diagnostics; using System.IO; -using System.Text; using System.Xml; +using VocaluxeLib.PartyModes; -using Vocaluxe.PartyModes; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { struct SThemeSongMenu { public string Name; - + public string CoverBackgroundName; public string CoverBigBackgroundName; public string DuetIconName; @@ -29,47 +27,41 @@ namespace Vocaluxe.Menu.SongMenu public SThemeSongMenuTileBoard songMenuTileBoard; } - struct SThemeSongMenuBook - { - } + struct SThemeSongMenuBook {} - struct SThemeSongMenuDreidel - { - } + struct SThemeSongMenuDreidel {} - struct SThemeSongMenuList - { - } + struct SThemeSongMenuList {} struct SThemeSongMenuTileBoard { /// - /// Number of tiles horizontal + /// Number of tiles horizontal /// public int numW; /// - /// Number of tiles vertical + /// Number of tiles vertical /// public int numH; /// - /// Number of tiles horizontal in small-modus + /// Number of tiles horizontal in small-modus /// public int numWsmall; /// - /// Number of tiles vertical in small-modus + /// Number of tiles vertical in small-modus /// public int numHsmall; /// - /// Space between tiles horizontal + /// Space between tiles horizontal /// public float spaceW; /// - /// Space between tiles vertical + /// Space between tiles vertical /// public float spaceH; @@ -94,9 +86,9 @@ namespace Vocaluxe.Menu.SongMenu protected SThemeSongMenu _Theme; private bool _ThemeLoaded; - private Stopwatch _timer = new Stopwatch(); - private Stopwatch _VideoFadeTimer = new Stopwatch(); - private List _streams = new List(); + private readonly Stopwatch _timer = new Stopwatch(); + private readonly Stopwatch _VideoFadeTimer = new Stopwatch(); + private readonly List _streams = new List(); private int _video = -1; private int _actsong = -1; private int _actsongstream = -1; @@ -118,8 +110,9 @@ namespace Vocaluxe.Menu.SongMenu protected float _MaxVolume = 100f; - protected int _PreviewSelected //for preview only + protected int _PreviewSelected { + //for preview only get { if ((_SelectedInternal != _SelectedPending) && (_timer.ElapsedMilliseconds >= _PendingTime)) @@ -157,7 +150,6 @@ namespace Vocaluxe.Menu.SongMenu _SelectedInternal = _SelectedPending; } } - } protected virtual void SetSelectedNow() @@ -167,8 +159,9 @@ namespace Vocaluxe.Menu.SongMenu _SelectedInternal = _SelectedPending; } - protected int _Locked //the real selected song for singing + protected int _Locked { + //the real selected song for singing get { return _LockedInternal; } set { _LockedInternal = value; } } @@ -208,7 +201,7 @@ namespace Vocaluxe.Menu.SongMenu return _actsong; } - private bool _Selected = false; + private bool _Selected; private bool _Visible = true; public bool IsSelected() @@ -269,9 +262,7 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= xmlReader.GetValue(item + "/MedleyTagIcon", ref _Theme.MedleyTagIcon, String.Empty); if (xmlReader.GetValue(item + "/Color", ref _Theme.ColorName, String.Empty)) - { - _ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, ref _Color); - } + _ThemeLoaded &= CBase.Theme.GetColor(_Theme.ColorName, SkinIndex, out _Color); else { _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/R", ref _Color.R); @@ -311,7 +302,6 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallZ", ref _Theme.songMenuTileBoard.TileRectSmall.Z); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallW", ref _Theme.songMenuTileBoard.TileRectSmall.W); _ThemeLoaded &= xmlReader.TryGetFloatValue(item + "/SongMenuTileBoard/TileRectSmallH", ref _Theme.songMenuTileBoard.TileRectSmall.H); - #endregion SongMenuTileBoard if (_ThemeLoaded) @@ -350,10 +340,8 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteComment(": Tile color from ColorScheme (high priority)"); writer.WriteComment("or , , , (lower priority)"); - if (_Theme.ColorName != String.Empty) - { + if (_Theme.ColorName.Length > 0) writer.WriteElementString("Color", _Theme.ColorName); - } else { writer.WriteElementString("R", _Color.R.ToString("#0.00")); @@ -408,7 +396,7 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.StaticVideoIcon.SaveTheme(writer); _Theme.songMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer); _Theme.songMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer); - + writer.WriteEndElement(); #endregion SongMenuTileBoard @@ -449,13 +437,11 @@ namespace Vocaluxe.Menu.SongMenu } float time = CBase.Sound.GetPosition(_actsongstream); - + float vtime = 0f; CBase.Video.GetFrame(_video, ref _vidtex, time, ref vtime); if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L) - { - _vidtex.color.A = (_VideoFadeTimer.ElapsedMilliseconds / 3000f); - } + _vidtex.color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f; else { _vidtex.color.A = 1f; @@ -473,15 +459,13 @@ namespace Vocaluxe.Menu.SongMenu public virtual void OnHide() { foreach (int stream in _streams) - { CBase.Sound.FadeAndStop(stream, 0f, 0.75f); - } _streams.Clear(); CBase.Video.Close(_video); _video = -1; - CBase.Drawing.RemoveTexture(ref _vidtex); + CBase.Drawing.RemoveTexture(ref _vidtex); _timer.Stop(); _timer.Reset(); @@ -506,10 +490,7 @@ namespace Vocaluxe.Menu.SongMenu return; if (_video != -1) - { CBase.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0)); - } - } public virtual void ApplyVolume(float VolumeMax) @@ -517,9 +498,7 @@ namespace Vocaluxe.Menu.SongMenu _MaxVolume = VolumeMax; foreach (int stream in _streams) - { CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume); - } } public virtual bool IsActive() @@ -570,15 +549,13 @@ namespace Vocaluxe.Menu.SongMenu return false; } - public virtual void UnloadTextures() - { - } + public virtual void UnloadTextures() {} public virtual void LoadTextures() { Init(); - if (_Theme.ColorName != String.Empty) + if (_Theme.ColorName.Length > 0) _Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID); } @@ -588,6 +565,16 @@ namespace Vocaluxe.Menu.SongMenu LoadTextures(); } + public bool EnterCurrentCategory() + { + if (!_Initialized) + return false; + if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories()) + return false; + EnterCategory(_PreviewSelected); + return true; + } + protected virtual void EnterCategory(int Category) { if (!_Initialized) @@ -605,8 +592,8 @@ namespace Vocaluxe.Menu.SongMenu if (!_Initialized) return; - if (CBase.Songs.GetCurrentCategoryIndex() != -1) - Reset(); + if (CBase.Songs.GetCurrentCategoryIndex() == -1) + return; Reset(); CBase.Songs.SetCategory(-1); @@ -622,9 +609,7 @@ namespace Vocaluxe.Menu.SongMenu if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0))) { foreach (int stream in _streams) - { CBase.Sound.FadeAndStop(stream, 0f, 1f); - } _streams.Clear(); CBase.Video.Close(_video); @@ -651,8 +636,8 @@ namespace Vocaluxe.Menu.SongMenu CBase.Sound.Fade(_stream, 100f, 3f); _streams.Add(_stream); _actsongstream = _stream; - - if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON) + + if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON) { _video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).VideoFileName)); if (_video == -1) @@ -668,9 +653,7 @@ namespace Vocaluxe.Menu.SongMenu protected void Reset() { foreach (int stream in _streams) - { CBase.Sound.FadeAndStop(stream, 0f, 0.75f); - } _streams.Clear(); CBase.Video.Close(_video); @@ -708,4 +691,4 @@ namespace Vocaluxe.Menu.SongMenu } #endregion ThemeEdit } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs index 71cd11aa..dca53e30 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { class CSongMenuList : CSongMenuFramework { public CSongMenuList(int PartyModeID) - : base(PartyModeID) - { - } + : base(PartyModeID) {} } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 89a26d3c..39fdcd15 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -1,13 +1,10 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Text; using System.Windows.Forms; +using VocaluxeLib.PartyModes; -using Vocaluxe.Menu.SongMenu; -using Vocaluxe.PartyModes; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { class CSongMenuTileBoard : CSongMenuFramework { @@ -26,7 +23,7 @@ namespace Vocaluxe.Menu.SongMenu private CText _Artist; private CText _Title; private CText _SongLength; - + private int _NumW; private int _NumH; @@ -36,16 +33,14 @@ namespace Vocaluxe.Menu.SongMenu private int _TileW; private int _TileH; - private int _Offset = 0; + private int _Offset = -1; private int _actualSelection = -1; - private bool _SmallView = false; + private bool _SmallView; public CSongMenuTileBoard(int PartyModeID) - : base(PartyModeID) - { - } - + : base(PartyModeID) {} + public override int GetActualSelection() { return _actualSelection; @@ -56,7 +51,7 @@ namespace Vocaluxe.Menu.SongMenu base.Init(); _Rect = _Theme.songMenuTileBoard.TileRect; - + _NumW = _Theme.songMenuTileBoard.numW; _NumH = _Theme.songMenuTileBoard.numH; _SpaceW = _Theme.songMenuTileBoard.spaceW; @@ -76,7 +71,7 @@ namespace Vocaluxe.Menu.SongMenu for (int j = 0; j < _NumW; j++) { SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), - _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); + _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect); _Tiles.Add(tile); } @@ -108,22 +103,18 @@ namespace Vocaluxe.Menu.SongMenu _Locked = _PreviewSelected; _actualSelection = _PreviewSelected; for (int i = 0; i < _Tiles.Count; i++) - { _Tiles[i].Selected = _Locked == i + _Offset; - } } } - + public override void OnShow() { if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && CBase.Songs.GetCurrentCategoryIndex() == -1) - { EnterCategory(0); - } _actualSelection = -1; _Locked = -1; _PreviewSelected = -1; - UpdateList(0); + UpdateList(0, true); //AfterCategoryChange(); SetSelectedSong(_ActSong); AfterCategoryChange(); @@ -144,7 +135,7 @@ namespace Vocaluxe.Menu.SongMenu _MedleyTagIcon.Visible = false; } - if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != String.Empty) + if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0) { _CoverBig.Texture = _CoverBigTexture; _Artist.Text = String.Empty; @@ -163,15 +154,11 @@ namespace Vocaluxe.Menu.SongMenu { base.HandleInput(ref KeyEvent, SongOptions); - if (KeyEvent.KeyPressed) - { - // - } - else + if (!KeyEvent.KeyPressed) { if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down || - KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter || - KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp)) + KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter || + KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp)) return; bool sel = false; @@ -183,21 +170,19 @@ namespace Vocaluxe.Menu.SongMenu break; } } - + if ((_Locked == -1 || !sel) && (KeyEvent.Key != Keys.Escape && KeyEvent.Key != Keys.Back && KeyEvent.Key != Keys.PageUp && KeyEvent.Key != Keys.PageDown)) { if (_PreviewSelected > -1) - { _Locked = _PreviewSelected; - } else { _Locked = 0; _actualSelection = 0; _PreviewSelected = 0; SetSelectedNow(); - UpdateList(0); + UpdateList(0, true); } } else @@ -211,9 +196,7 @@ namespace Vocaluxe.Menu.SongMenu KeyEvent.Handled = true; } else if (_actualSelection > -1 && _PreviewSelected >= 0) - { _Locked = _actualSelection; - } break; case Keys.Escape: @@ -231,25 +214,19 @@ namespace Vocaluxe.Menu.SongMenu case Keys.PageUp: if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed) - { PrevCategory(); - } break; case Keys.PageDown: if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed) - { NextCategory(); - } break; case Keys.Left: if (_Locked > 0 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0)) { _Locked--; - if (CBase.Songs.GetCurrentCategoryIndex() < 0 && _Locked < CBase.Songs.GetNumCategories() - _NumW || - CBase.Songs.GetCurrentCategoryIndex() >= 0 && _Locked < CBase.Songs.GetNumVisibleSongs() - _NumW) - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + UpdateList(); } break; @@ -259,18 +236,15 @@ namespace Vocaluxe.Menu.SongMenu if (_Locked < CBase.Songs.GetNumCategories() - 1) { _Locked++; - if (_Locked < CBase.Songs.GetNumCategories() - _NumW) - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + UpdateList(); } - } else { if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumVisibleSongs() - 1 && !SongOptions.Selection.RandomOnly) { _Locked++; - if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW) - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + UpdateList(); } } break; @@ -282,10 +256,11 @@ namespace Vocaluxe.Menu.SongMenu break; } - if (_Locked > _NumW - 1 && (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0)) + if (_Locked > _NumW - 1 && + (!SongOptions.Selection.RandomOnly || SongOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0)) { _Locked -= _NumW; - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + UpdateList(); } break; @@ -301,22 +276,15 @@ namespace Vocaluxe.Menu.SongMenu if (_Locked < CBase.Songs.GetNumCategories() - _NumW) { _Locked += _NumW; - if (_Locked < CBase.Songs.GetNumCategories() - _NumW) - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + UpdateList(); } - } - else + else if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly) { - if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW && !SongOptions.Selection.RandomOnly) - { - _Locked += _NumW; - if (_Locked < CBase.Songs.GetNumVisibleSongs() - _NumW) - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); - } + _Locked += _NumW; + UpdateList(); } break; - } } @@ -326,11 +294,9 @@ namespace Vocaluxe.Menu.SongMenu _actualSelection = _Locked; for (int i = 0; i < _Tiles.Count; i++) - { _Tiles[i].Selected = _Locked == i + _Offset; - } } - } + } } public override void HandleMouse(ref MouseEvent MouseEvent, ScreenSongOptions SongOptions) @@ -362,9 +328,7 @@ namespace Vocaluxe.Menu.SongMenu sel = true; } else - { tile.Selected = false; - } i++; } } @@ -377,24 +341,21 @@ namespace Vocaluxe.Menu.SongMenu if (!sel) _actualSelection = -1; - if ((MouseEvent.RB) && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && SongOptions.Selection.CategoryChangeAllowed) + if (MouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && + SongOptions.Selection.CategoryChangeAllowed) { ShowCategories(); MouseEvent.Handled = true; return; } else if (MouseEvent.RB && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && !SongOptions.Selection.PartyMode) - { CBase.Graphics.FadeTo(EScreens.ScreenMain); - } else if (_PreviewSelected != -1 && MouseEvent.LB && CBase.Songs.GetCurrentCategoryIndex() != -1 && !SongOptions.Selection.PartyMode) { if (CHelper.IsInBounds(_CoverBig.Rect, MouseEvent) || CHelper.IsInBounds(_TextBG.Rect, MouseEvent)) - { _Locked = _PreviewSelected; - } } - else if ((MouseEvent.LB) && (CBase.Songs.GetCurrentCategoryIndex() == -1)) + else if (MouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1)) { foreach (CStatic tile in _Tiles) { @@ -407,31 +368,9 @@ namespace Vocaluxe.Menu.SongMenu } } - if (MouseEvent.Wheel > 0) - { - if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)) - { - if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetNumVisibleSongs() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1) || - CBase.Songs.GetCurrentCategoryIndex() < 0 && CBase.Songs.GetNumCategories() > _Offset + _NumW * MouseEvent.Wheel + _NumW * (_NumH - 1)) - { - _Offset += _NumW * MouseEvent.Wheel; - UpdateList(_Offset); - } - } - } - - if (MouseEvent.Wheel < 0) - { - if (CHelper.IsInBounds(_ScrollRect, MouseEvent) && (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)) - { - _Offset += _NumW * MouseEvent.Wheel; - if (_Offset < 0) - { - _Offset = 0; - } - UpdateList(_Offset); - } - } + if (MouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, MouseEvent) && + (!SongOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && SongOptions.Selection.CategoryChangeAllowed)) + UpdateList(_Offset + _NumW * MouseEvent.Wheel); } public override void Draw() @@ -511,11 +450,11 @@ namespace Vocaluxe.Menu.SongMenu CBase.Drawing.DrawTexture(_vidtex, vidRect, _vidtex.color, vidRectBounds, false); CBase.Drawing.DrawTextureReflection(_vidtex, vidRect, _vidtex.color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight); - }else + } + else _CoverBig.Draw(1f, EAspect.Crop); - _Artist.Draw(); _Title.Draw(); _SongLength.Draw(); @@ -523,7 +462,6 @@ namespace Vocaluxe.Menu.SongMenu _VideoIcon.Draw(); _MedleyCalcIcon.Draw(); _MedleyTagIcon.Draw(); - } public override int GetSelectedSong() @@ -541,117 +479,62 @@ namespace Vocaluxe.Menu.SongMenu return new CStatic(_PartyModeID); } + protected void SetSelectedTile(int itemNr) + { + bool sel = false; + foreach (CStatic tile in _Tiles) + { + if (tile.Selected) + { + sel = true; + break; + } + } + + if (_Locked == -1 || !sel) + { + if (_PreviewSelected > -1) + _Locked = _PreviewSelected; + else + { + _Locked = 0; + _actualSelection = 0; + _PreviewSelected = 0; + SetSelectedNow(); + UpdateList(0, true); + } + } + + foreach (CStatic tile in _Tiles) + tile.Selected = false; + + _PreviewSelected = itemNr; + SetSelectedNow(); + _Locked = itemNr; + + UpdateList(true); + + _PreviewSelected = _Locked; + _actualSelection = _Locked; + + if (_Locked - _Offset >= 0) + _Tiles[_Locked - _Offset].Selected = true; + } + public override void SetSelectedSong(int VisibleSongNr) { base.SetSelectedSong(VisibleSongNr); - if (VisibleSongNr < 0) - return; - - if (CBase.Songs.GetNumVisibleSongs() > VisibleSongNr) - { - bool sel = false; - foreach (CStatic tile in _Tiles) - { - if (tile.Selected) - { - sel = true; - break; - } - } - - if (_Locked == -1 || !sel) - { - if (_PreviewSelected > -1) - { - _Locked = _PreviewSelected; - } - else - { - _Locked = 0; - _actualSelection = 0; - _PreviewSelected = 0; - SetSelectedNow(); - UpdateList(0); - } - } - - foreach (CStatic tile in _Tiles) - { - tile.Selected = false; - } - - _PreviewSelected = VisibleSongNr; - SetSelectedNow(); - _Locked = VisibleSongNr; - - UpdateList((VisibleSongNr / _NumW) * _NumW - (_NumW * (_NumH - 2))); - - _PreviewSelected = _Locked; - _actualSelection = _Locked; - - for (int i = 0; i < _Tiles.Count; i++) - { - _Tiles[i].Selected = _Locked == i + _Offset; - } - } - + if (VisibleSongNr >= 0 && VisibleSongNr < CBase.Songs.GetNumVisibleSongs()) + SetSelectedTile(VisibleSongNr); } public override void SetSelectedCategory(int CategoryNr) { base.SetSelectedCategory(CategoryNr); - if (CategoryNr < 0) - return; - - if (CBase.Songs.GetNumCategories() > CategoryNr) - { - bool sel = false; - foreach (CStatic tile in _Tiles) - { - if (tile.Selected) - { - sel = true; - break; - } - } - - if (_Locked == -1 || !sel) - { - if (_PreviewSelected > -1) - { - _Locked = _PreviewSelected; - } - else - { - _Locked = 0; - _actualSelection = 0; - _PreviewSelected = 0; - SetSelectedNow(); - UpdateList(0); - } - } - - foreach (CStatic tile in _Tiles) - { - tile.Selected = false; - } - - _PreviewSelected = CategoryNr; - SetSelectedNow(); - _Locked = CategoryNr; - - UpdateList((CategoryNr / _NumW) * _NumW - (_NumW * (_NumH - 2))); - - _PreviewSelected = _Locked; - _actualSelection = _Locked; - - for (int i = 0; i < _Tiles.Count; i++) - { - _Tiles[i].Selected = _Locked == i + _Offset; - } - } + if (CategoryNr >= 0 && CategoryNr < CBase.Songs.GetNumCategories()) + SetSelectedTile(CategoryNr); } protected override void EnterCategory(int cat) @@ -700,66 +583,53 @@ namespace Vocaluxe.Menu.SongMenu SelectSong(_PreviewSelected); foreach (CStatic tile in _Tiles) - { tile.Selected = false; - } if (_actualSelection >= 0 && _actualSelection < _Tiles.Count) _Tiles[_actualSelection].Selected = true; - + if ((_LastKnownNumSongs == CBase.Songs.GetNumVisibleSongs()) && (_LastKnownCategory == CBase.Songs.GetCurrentCategoryIndex())) return; _LastKnownCategory = CBase.Songs.GetCurrentCategoryIndex(); _LastKnownNumSongs = CBase.Songs.GetNumVisibleSongs(); - UpdateList(0); + UpdateList(0, true); CBase.Songs.UpdateRandomSongList(); } - private void UpdateList(int offset) + private void UpdateList(bool force = false) { - if (CBase.Songs.GetCurrentCategoryIndex() > -1) - { - if (offset >= (CBase.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1))) - offset = (CBase.Songs.GetNumVisibleSongs() / _NumW) * _NumW - (_NumW * (_NumH - 1)); - } - else - { - if (offset >= (CBase.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1))) - offset = (CBase.Songs.GetNumCategories() / _NumW) * _NumW - (_NumW * (_NumH - 1)); - } + UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2)), force); + } + + private void UpdateList(int offset, bool force = false) + { + bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0; + int itemCount = isInCategory ? CBase.Songs.GetNumVisibleSongs() : CBase.Songs.GetNumCategories(); + + if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1))) + offset = (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)); if (offset < 0) offset = 0; + if (offset == _Offset && !force) + return; + for (int i = 0; i < _Tiles.Count; i++) { - if (CBase.Songs.GetCurrentCategoryIndex() >= 0) + if (itemCount > i + offset) { - if (CBase.Songs.GetNumVisibleSongs() > i + offset) - { + if (isInCategory) _Tiles[i].Texture = CBase.Songs.GetVisibleSong(i + offset).CoverTextureSmall; - _Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f); - } else - { - _Tiles[i].Texture = _CoverTexture; - _Tiles[i].Color = _Color; - } - } - - if (CBase.Songs.GetCurrentCategoryIndex() == -1) - { - if (CBase.Songs.GetNumCategories() > i + offset) - { _Tiles[i].Texture = CBase.Songs.GetCategory(i + offset).CoverTextureSmall; - _Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f); - } - else - { - _Tiles[i].Texture = _CoverTexture; - _Tiles[i].Color = _Color; - } + _Tiles[i].Color = new SColorF(1f, 1f, 1f, 1f); + } + else + { + _Tiles[i].Texture = _CoverTexture; + _Tiles[i].Color = _Color; } } _Offset = offset; @@ -775,56 +645,34 @@ namespace Vocaluxe.Menu.SongMenu { _NumH = _Theme.songMenuTileBoard.numHsmall; _NumW = _Theme.songMenuTileBoard.numWsmall; - - _TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW); - _TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH); - - _CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID); - _CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID); - - _Tiles = new List(); - for (int i = 0; i < _NumH; i++) - { - for (int j = 0; j < _NumW; j++) - { - SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW), - _Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); - CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect); - _Tiles.Add(tile); - } - } - _Rect = _Theme.songMenuTileBoard.TileRectSmall; - _ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRectSmall.Z); } else { _NumH = _Theme.songMenuTileBoard.numH; _NumW = _Theme.songMenuTileBoard.numW; - - _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW); - _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH); - - _CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID); - _CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID); - - _Tiles = new List(); - for (int i = 0; i < _NumH; i++) - { - for (int j = 0; j < _NumW; j++) - { - SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), - _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); - CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect); - _Tiles.Add(tile); - } - } - _Rect = _Theme.songMenuTileBoard.TileRect; - _ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Theme.songMenuTileBoard.TileRect.Z); } - UpdateList((_Locked / _NumW) * _NumW - (_NumW * (_NumH - 2))); + _TileW = (int)((_Rect.W - _SpaceW * (_NumW - 1)) / _NumW); + _TileH = (int)((_Rect.H - _SpaceH * (_NumH - 1)) / _NumH); + + _CoverTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBackgroundName, _PartyModeID); + _CoverBigTexture = CBase.Theme.GetSkinTexture(_Theme.CoverBigBackgroundName, _PartyModeID); + + _Tiles = new List(); + for (int i = 0; i < _NumH; i++) + { + for (int j = 0; j < _NumW; j++) + { + SRectF rect = new SRectF(_Rect.X + j * (_TileW + _SpaceW), _Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); + CStatic tile = new CStatic(_PartyModeID, _CoverTexture, Color, rect); + _Tiles.Add(tile); + } + } + + _ScrollRect = new SRectF(0, 0, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), _Rect.Z); + UpdateList(true); } public override bool IsSmallView() @@ -848,4 +696,4 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.TextSongLength.ReloadTextures(); } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs index e5c3d60f..a08a24e0 100644 --- a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; +using VocaluxeLib.PartyModes; -using Vocaluxe.PartyModes; - -namespace Vocaluxe.Menu.SongMenu +namespace VocaluxeLib.Menu.SongMenu { interface ISongMenu : IMenuElement { @@ -29,6 +25,8 @@ namespace Vocaluxe.Menu.SongMenu void SetSelectedCategory(int CategoryNr); int GetActualSelection(); + bool EnterCurrentCategory(); + bool IsSelected(); void SetSelected(bool Selected); @@ -40,4 +38,4 @@ namespace Vocaluxe.Menu.SongMenu SRectF GetRect(); } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Menu/Structs.cs b/VocaluxeLib/Menu/Structs.cs new file mode 100644 index 00000000..41938220 --- /dev/null +++ b/VocaluxeLib/Menu/Structs.cs @@ -0,0 +1,292 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +using VocaluxeLib.Menu.SingNotes; + +namespace VocaluxeLib.Menu +{ + #region Drawing + public struct SColorF + { + public float R; + public float G; + public float B; + public float A; + + public SColorF(float r, float g, float b, float a) + { + R = r; + G = g; + B = b; + A = a; + } + + public SColorF(SColorF Color) + { + R = Color.R; + G = Color.G; + B = Color.B; + A = Color.A; + } + } + + public struct SRectF + { + public float X; + public float Y; + public float W; + public float H; + public float Z; + public float Rotation; //0..360° + + public SRectF(float x, float y, float w, float h, float z) + { + X = x; + Y = y; + W = w; + H = h; + Z = z; + Rotation = 0f; + } + + public SRectF(SRectF rect) + { + X = rect.X; + Y = rect.Y; + W = rect.W; + H = rect.H; + Z = rect.Z; + Rotation = 0f; + } + } + + public struct SPoint3f + { + public float X; + public float Y; + public float Z; + } + + public struct SPoint3 + { + public int X; + public int Y; + public int Z; + } + + public struct STexture + { + public int index; + public int PBO; + public int ID; + + public string TexturePath; + + public float width; + public float height; + public SRectF rect; + + public float w2; //power of 2 width + public float h2; //power of 2 height + public float width_ratio; + public float height_ratio; + + public SColorF color; + + public STexture(int Index) + { + index = Index; + PBO = 0; + ID = -1; + TexturePath = String.Empty; + + width = 1f; + height = 1f; + rect = new SRectF(0f, 0f, 1f, 1f, 0f); + + w2 = 2f; + h2 = 2f; + width_ratio = 0.5f; + height_ratio = 0.5f; + + color = new SColorF(1f, 1f, 1f, 1f); + } + } + #endregion Drawing + + #region Inputs + public struct KeyEvent + { + public ESender Sender; + public bool ModALT; + public bool ModSHIFT; + public bool ModCTRL; + public bool KeyPressed; + public bool Handled; + public Keys Key; + public Char Unicode; + public EModifier Mod; + + public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key) + { + Sender = sender; + ModALT = alt; + ModSHIFT = shift; + ModCTRL = ctrl; + KeyPressed = pressed; + Unicode = unicode; + Key = key; + Handled = false; + + Mod = EModifier.None; + + if (alt) + Mod |= EModifier.Alt; + if (shift) + Mod |= EModifier.Shift; + if (ctrl) + Mod |= EModifier.Ctrl; + } + } + + public struct MouseEvent + { + public ESender Sender; + public bool Handled; + public int X; + public int Y; + public bool LB; //left button click + public bool LD; //left button double click + public bool RB; //right button click + public bool MB; //middle button click + + public bool LBH; //left button hold (when moving) + public bool RBH; //right button hold (when moving) + public bool MBH; //middle button hold (when moving) + + public bool ModALT; + public bool ModSHIFT; + public bool ModCTRL; + + public EModifier Mod; + public int Wheel; + + public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh) + { + Sender = sender; + Handled = false; + X = x; + Y = y; + LB = lb; + LD = ld; + RB = rb; + MB = mb; + + LBH = lbh; + RBH = rbh; + MBH = mbh; + + ModALT = alt; + ModSHIFT = shift; + ModCTRL = ctrl; + + EModifier mALT = EModifier.None; + EModifier mSHIFT = EModifier.None; + EModifier mCTRL = EModifier.None; + + if (alt) + mALT = EModifier.Alt; + + if (shift) + mSHIFT = EModifier.Shift; + + if (ctrl) + mCTRL = EModifier.Ctrl; + + if (!alt && !shift && !ctrl) + Mod = EModifier.None; + else + Mod = mALT | mSHIFT | mCTRL; + + Wheel = wheel; + } + } + #endregion Inputs + + #region Profiles + public struct SProfile + { + public string PlayerName; + public string ProfileFile; + + public EGameDifficulty Difficulty; + public SAvatar Avatar; + public EOffOn GuestProfile; + public EOffOn Active; + } + + public struct SAvatar + { + public string FileName; + public STexture Texture; + + public SAvatar(int dummy) + { + FileName = String.Empty; + Texture = new STexture(-1); + } + } + #endregion Profiles + + #region Game + public struct SPlayer + { + public int ProfileID; + public string Name; + public EGameDifficulty Difficulty; + public double Points; + public double PointsLineBonus; + public double PointsGoldenNotes; + public int NoteDiff; + public int LineNr; + public List SingLine; + public int CurrentLine; + public int CurrentNote; + + public int SongID; + public bool Medley; + public bool Duet; + public bool ShortSong; + public long DateTicks; + public bool SongFinished; + } + + public struct SScores + { + public string Name; + public int Score; + public string Date; + public EGameDifficulty Difficulty; + public int LineNr; + public int ID; + } + + public struct SPartyModeInfos + { + public int PartyModeID; + public string Name; + public string Description; + public string TargetAudience; + public int MaxPlayers; + public int MinPlayers; + public int MaxTeams; + public int MinTeams; + + public string Author; + public bool Playable; + public int VersionMajor; + public int VersionMinor; + } + #endregion Game +} \ No newline at end of file diff --git a/VocaluxeLib/PartyModes/CPartyMode.cs b/VocaluxeLib/PartyModes/CPartyMode.cs index b145ee64..e8da0e3e 100644 --- a/VocaluxeLib/PartyModes/CPartyMode.cs +++ b/VocaluxeLib/PartyModes/CPartyMode.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using System.Text; +using VocaluxeLib.Menu; -using Vocaluxe.Menu; - -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes { public abstract class CPartyMode : IPartyMode { @@ -27,22 +25,16 @@ namespace Vocaluxe.PartyModes return false; } - public void Initialize() - { - } + public void Initialize() {} public void AddScreen(CMenuParty Screen, string ScreenName) { _Screens.Add(ScreenName, Screen); } - public virtual void DataFromScreen(string ScreenName, Object Data) - { - } + public virtual void DataFromScreen(string ScreenName, Object Data) {} - public virtual void UpdateGame() - { - } + public virtual void UpdateGame() {} public virtual CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen) { @@ -65,13 +57,9 @@ namespace Vocaluxe.PartyModes return new ScreenSongOptions(); } - public virtual void OnSongChange(int SongIndex, ref ScreenSongOptions ScreenSongOptions) - { - } + public virtual void OnSongChange(int SongIndex, ref ScreenSongOptions ScreenSongOptions) {} - public virtual void OnCategoryChange(int CategoryIndex, ref ScreenSongOptions ScreenSongOptions) - { - } + public virtual void OnCategoryChange(int CategoryIndex, ref ScreenSongOptions ScreenSongOptions) {} public virtual int GetMaxPlayer() { @@ -98,9 +86,7 @@ namespace Vocaluxe.PartyModes return 1; } - public virtual void SetSearchString(string SearchString, bool Visible) - { - } + public virtual void SetSearchString(string SearchString, bool Visible) {} public virtual void JokerUsed(int TeamNr) { @@ -114,9 +100,7 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Selection.NumJokers[TeamNr]--; } - public virtual void SongSelected(int SongID) - { - } + public virtual void SongSelected(int SongID) {} public virtual void FinishedSinging() { @@ -134,4 +118,4 @@ namespace Vocaluxe.PartyModes } #endregion Implementation } -} +} \ No newline at end of file diff --git a/VocaluxeLib/PartyModes/CPartyModeNone.cs b/VocaluxeLib/PartyModes/CPartyModeNone.cs index 10d33c7c..50f4003d 100644 --- a/VocaluxeLib/PartyModes/CPartyModeNone.cs +++ b/VocaluxeLib/PartyModes/CPartyModeNone.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.Generic; -using System.Text; +using VocaluxeLib.Menu; -using Vocaluxe.Menu; - -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes { public class CPartyModeNone : CPartyMode { @@ -20,7 +17,7 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Sorting.SearchString = String.Empty; _ScreenSongOptions.Sorting.SearchActive = false; - _ScreenSongOptions.Sorting.ShowDuetSongs = true; + _ScreenSongOptions.Sorting.DuetOptions = EDuetOptions.All; } public override ScreenSongOptions GetScreenSongOptions() @@ -42,4 +39,4 @@ namespace Vocaluxe.PartyModes _ScreenSongOptions.Sorting.SearchActive = Visible; } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/PartyModes/CScreenPartyDummy.cs b/VocaluxeLib/PartyModes/CScreenPartyDummy.cs index 445a4c3a..88b8dbd5 100644 --- a/VocaluxeLib/PartyModes/CScreenPartyDummy.cs +++ b/VocaluxeLib/PartyModes/CScreenPartyDummy.cs @@ -1,37 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; +using System.Windows.Forms; +using VocaluxeLib.Menu; -using Vocaluxe.Menu; - -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes { public class CScreenPartyDummy : CMenuParty { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 1; + protected override int _ScreenVersion + { + get { return 1; } + } private CText Warning; - public CScreenPartyDummy() - { - } - - protected override void Init() - { - base.Init(); - - _ThemeName = "ScreenPartyDummy"; - _ScreenVersion = ScreenVersion; - } - public override void LoadTheme(string XmlPath) { Warning = GetNewText(); Warning.Height = 100f; Warning.X = 150; Warning.Y = 300; - Warning.Fon = "Normal"; + Warning.Font = "Normal"; Warning.Style = EStyle.Normal; Warning.Color = new SColorF(1f, 0f, 0f, 1f); Warning.SColor = new SColorF(1f, 0f, 0f, 1f); @@ -39,33 +26,22 @@ namespace Vocaluxe.PartyModes AddText(Warning); } - public override void ReloadTheme(string XmlPath) + public override void ReloadTheme(string XmlPath) {} + + public override void ReloadTextures() {} + + public override void SaveTheme() {} + + public override void UnloadTextures() {} + + public override bool HandleInput(KeyEvent keyEvent) { - } + base.HandleInput(keyEvent); - public override void ReloadTextures() - { - } - - public override void SaveTheme() - { - } - - public override void UnloadTextures() - { - } - - public override bool HandleInput(KeyEvent KeyEvent) - { - base.HandleInput(KeyEvent); - - if (KeyEvent.KeyPressed) - { - - } + if (keyEvent.KeyPressed) {} else { - switch (KeyEvent.Key) + switch (keyEvent.Key) { case Keys.Back: case Keys.Escape: @@ -76,28 +52,18 @@ namespace Vocaluxe.PartyModes return true; } - public override bool HandleMouse(MouseEvent MouseEvent) + public override bool HandleMouse(MouseEvent mouseEvent) { - base.HandleMouse(MouseEvent); + base.HandleMouse(mouseEvent); - if (MouseEvent.LB && IsMouseOver(MouseEvent)) - { + if (mouseEvent.LB && IsMouseOver(mouseEvent)) {} - } - - if (MouseEvent.RB) - { + if (mouseEvent.RB) FadeTo(EScreens.ScreenParty); - } return true; } - public override void OnShow() - { - base.OnShow(); - } - public override bool UpdateGame() { return true; @@ -108,10 +74,5 @@ namespace Vocaluxe.PartyModes base.Draw(); return true; } - - public override void OnClose() - { - base.OnClose(); - } } -} +} \ No newline at end of file diff --git a/VocaluxeLib/PartyModes/IPartyMode.cs b/VocaluxeLib/PartyModes/IPartyMode.cs index 99c3e532..faa03c8b 100644 --- a/VocaluxeLib/PartyModes/IPartyMode.cs +++ b/VocaluxeLib/PartyModes/IPartyMode.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; -using System.Text; +using VocaluxeLib.Menu; -using Vocaluxe.Menu; - -namespace Vocaluxe.PartyModes +namespace VocaluxeLib.PartyModes { + #region Structs public struct ScreenSongOptions { @@ -20,46 +18,46 @@ namespace Vocaluxe.PartyModes public EOffOn IgnoreArticles; public string SearchString; public bool SearchActive; - public bool ShowDuetSongs; + public EDuetOptions DuetOptions; } /// - /// Configuration of song selection options + /// Configuration of song selection options /// public struct SelectionOptions { /// - /// If != -1, the SongMenu should set the song selection on the provided song index (visible index) if possible + /// If != -1, the SongMenu should set the song selection on the provided song index (visible index) if possible /// public int SongIndex; /// - /// If true, the SongMenu should perform the select random song method + /// If true, the SongMenu should perform the select random song method /// public bool SelectNextRandomSong; /// - /// Choosing song only by random + /// Choosing song only by random /// public bool RandomOnly; /// - /// If true, it is not allowed to go to MainScreen nor open the playlist nor open the song menu + /// If true, it is not allowed to go to MainScreen nor open the playlist nor open the song menu /// public bool PartyMode; /// - /// If true, it is not alled to change or leave the category. It's only valid if Tabs=On. + /// If true, it is not alled to change or leave the category. It's only valid if Tabs=On. /// public bool CategoryChangeAllowed; /// - /// The number of jokers left for each team + /// The number of jokers left for each team /// public int[] NumJokers; /// - /// The Team Name of the teams (:>) + /// The Team Name of the teams (:>) /// public string[] TeamNames; } @@ -96,4 +94,4 @@ namespace Vocaluxe.PartyModes void LeavingScore(); void LeavingHighscore(); } -} +} \ No newline at end of file diff --git a/VocaluxeLib/Properties/AssemblyInfo.cs b/VocaluxeLib/Properties/AssemblyInfo.cs index 8dd7259c..48dc08f0 100644 --- a/VocaluxeLib/Properties/AssemblyInfo.cs +++ b/VocaluxeLib/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/VocaluxeLib/Settings.StyleCop b/VocaluxeLib/Settings.StyleCop new file mode 100644 index 00000000..72ed49f9 --- /dev/null +++ b/VocaluxeLib/Settings.StyleCop @@ -0,0 +1,809 @@ + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + \ No newline at end of file diff --git a/VocaluxeLib/VocaluxeLib.csproj b/VocaluxeLib/VocaluxeLib.csproj index 7a97fb5d..97fcaf9e 100644 --- a/VocaluxeLib/VocaluxeLib.csproj +++ b/VocaluxeLib/VocaluxeLib.csproj @@ -10,9 +10,9 @@ Properties VocaluxeLib VocaluxeLib - v2.0 + v4.0 512 - + Client AnyCPU @@ -46,6 +46,7 @@ prompt 4 Off + ..\CheckingRules.ruleset AnyCPU @@ -110,6 +111,7 @@ + @@ -121,13 +123,16 @@ + + + @@ -142,6 +147,7 @@ + diff --git a/gstreamerhelper/VocaluxeClock.cpp b/gstreamerhelper/VocaluxeClock.cpp index cfe7e677..ba84cfd0 100644 --- a/gstreamerhelper/VocaluxeClock.cpp +++ b/gstreamerhelper/VocaluxeClock.cpp @@ -70,7 +70,7 @@ vocaluxe_clock_get_internal_time (GstClock * clock) _vocaluxeclock = GST_VOCALUXE_CLOCK_CAST (clock); - result = _vocaluxeclock->time * GST_SECOND; + result = (GstClockTime) _vocaluxeclock->time * GST_SECOND; return result; }