Merge remote-tracking branch 'upstream/develop' into 6-player

This commit is contained in:
Florian Kuepper committed 2012-05-05 11:49:24 +02:00
commit b49b7097af
47 files changed
+2227 -203

No files matched your search

+1
View File
@@ -191,5 +191,6 @@
<TR_SCREENOVIDEO_VIDEOBACKGROUNDS>Video-Hintergründe</TR_SCREENOVIDEO_VIDEOBACKGROUNDS>
<TR_SCREENOVIDEO_VIDEOPREVIEW>Video-Vorschau</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos während des Singens</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>Videos der Hintergrundmusik</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
</Texts>
</root>
+1
View File
@@ -191,5 +191,6 @@
<TR_SCREENOVIDEO_VIDEOBACKGROUNDS>Video Backgrounds</TR_SCREENOVIDEO_VIDEOBACKGROUNDS>
<TR_SCREENOVIDEO_VIDEOPREVIEW>Video Preview</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos while singing</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>Display current backgroundmusic video</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
</Texts>
</root>
+1
View File
@@ -186,5 +186,6 @@
<TR_SCREENOVIDEO_VIDEOBACKGROUNDS>Vidéo en arrière plan</TR_SCREENOVIDEO_VIDEOBACKGROUNDS>
<TR_SCREENOVIDEO_VIDEOPREVIEW>Prévisualisation des Vidéos</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Vidéos pendant que l'on chante</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>TODO: Display current backgroundmusic video</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
</Texts>
</root>
+1
View File
@@ -186,5 +186,6 @@
<TR_SCREENOVIDEO_VIDEOBACKGROUNDS>Videos de Fondo</TR_SCREENOVIDEO_VIDEOBACKGROUNDS>
<TR_SCREENOVIDEO_VIDEOPREVIEW>Previsualización del Video</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos al Cantar</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>TODO: Display current backgroundmusic video</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
</Texts>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,442 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<PopupScreenPlayerControl>
<ScreenVersion>1</ScreenVersion>
<StaticBG>
<!--<Skin>: Texture name-->
<Skin>Menu</Skin>
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
<X>49</X>
<Y>0</Y>
<Z>0,00</Z>
<W>1181</W>
<H>50</H>
<!--<Color>: Static color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>Visible</Color>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</StaticBG>
<StaticCover>
<!--<Skin>: Texture name-->
<Skin>CoverBackground</Skin>
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
<X>50</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Static color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>Visible</Color>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</StaticCover>
<ButtonPrevious>
<!--<Skin>: Texture name-->
<Skin>PreviousIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>PreviousIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>125</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>2</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPrevious>
<ButtonPlay>
<!--<Skin>: Texture name-->
<Skin>PlayIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>PlayIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>200</X>
<Y>5</Y>
<Z>0,00</Z>
<W>40</W>
<H>40</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>2</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPlay>
<ButtonPause>
<!--<Skin>: Texture name-->
<Skin>PauseIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>PauseIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>200</X>
<Y>5</Y>
<Z>0,00</Z>
<W>40</W>
<H>40</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>2</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPause>
<ButtonNext>
<!--<Skin>: Texture name-->
<Skin>NextIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>NextIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>265</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>190</X>
<Y>25</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonNext>
<ButtonRepeat>
<!--<Skin>: Texture name-->
<Skin>RepeatIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>RepeatIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>330</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>405</X>
<Y>25</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonRepeat>
<ButtonShowVideo>
<!--<Skin>: Texture name-->
<Skin>VideoIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>VideoIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>405</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>315</X>
<Y>0</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonShowVideo>
<ButtonToBackgroundVideo>
<!--<Skin>: Texture name-->
<Skin>VideoIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>VideoIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>480</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>315</X>
<Y>0</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonToBackgroundVideo>
<ButtonSing>
<!--<Skin>: Texture name-->
<Skin>DuetIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>DuetIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>555</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>380</X>
<Y>0</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonSing>
<TextCurrentSong>
<!--<X>, <Y>: Text position-->
<X>630</X>
<Y>0</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>50</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>650</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Left</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Outline</Font>
<!--<Text>: Text or translation tag-->
<Text />
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</TextCurrentSong>
</PopupScreenPlayerControl>
</root>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<ScreenOptionsVideo>
<ScreenVersion>1</ScreenVersion>
<ScreenVersion>2</ScreenVersion>
<Background1>
<!--<Type>: Background type: None, Color, Texture, Video-->
<Type>Video</Type>
@@ -185,6 +185,33 @@
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text4>
<Text5>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>285</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Left</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text>TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text5>
<ButtonExit>
<!--<Skin>: Texture name-->
<Skin>Button</Skin>
@@ -435,5 +462,70 @@
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>3</NumVisible>
</SelectSlideVideosInSongs>
<SelectSlideVideosToBackground>
<!--<Skin>: Texture name-->
<Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow-->
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<!--<SkinArrowRight>: Texture name of right arrow-->
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<!--<SkinSelected>: Texture name for selected SelectSlide-->
<SkinSelected>SelectSlide</SkinSelected>
<!--<SkinArrowLeftSelected>: Texture name of selected left arrow-->
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<!--<SkinArrowRightSelected>: Texture name of selected right arrow-->
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<!--<SkinHighlighted>: Texture name for highlighted SelectSlide-->
<SkinHighlighted>SelectSlide</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>500</X>
<Y>280</Y>
<Z>0,00</Z>
<W>700</W>
<H>50</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>505</ArrowLeftX>
<ArrowLeftY>225</ArrowLeftY>
<ArrowLeftZ>0,00</ArrowLeftZ>
<ArrowLeftW>40</ArrowLeftW>
<ArrowLeftH>40</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>1170</ArrowRightX>
<ArrowRightY>225</ArrowRightY>
<ArrowRightZ>0,00</ArrowRightZ>
<ArrowRightW>40</ArrowRightW>
<ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor>
<!--<ArrowSColor>: Selected arrow color from ColorScheme (high priority)-->
<!--or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)-->
<ArrowSColor>ArrowSColor</ArrowSColor>
<!--<TextColor>: Text color from ColorScheme (high priority)-->
<!--or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)-->
<TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor>
<!--<TextH>: Text height-->
<TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)-->
<TextMaxW>205,33</TextMaxW>
<!--<TextFont>: Text font name-->
<TextFont>Normal</TextFont>
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
<TextStyle>Bold</TextStyle>
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>3</NumVisible>
</SelectSlideVideosToBackground>
</ScreenOptionsVideo>
</root>
+5
View File
@@ -301,6 +301,11 @@
<VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible>
<PlayerSelector>PlayerSelector.png</PlayerSelector>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins>
<Videos>
<BG_Video>[Blue]BG_Video.mp4</BG_Video>
+5
View File
@@ -301,6 +301,11 @@
<VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible>
<PlayerSelector>PlayerSelector.png</PlayerSelector>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins>
<Videos>
<BG_Video>[Green]BG_Video.mp4</BG_Video>
+5
View File
@@ -301,6 +301,11 @@
<VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible>
<PlayerSelector>PlayerSelector.png</PlayerSelector>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins>
<Videos>
<BG_Video>[Red]BG_Video.mp4</BG_Video>
+5
View File
@@ -301,6 +301,11 @@
<VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible>
<PlayerSelector>PlayerSelector.png</PlayerSelector>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins>
<Videos>
<BG_Video>[Yellow]BG_Video.mp4</BG_Video>
@@ -0,0 +1,10 @@
ScreenOptionsTheme
++++++++++
Version 2:
Add:
<SelectSlideVideosToBackground>
and some texts and statics for description (Text5)
"TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND"
++++++++++
+417 -25
View File
@@ -6,6 +6,9 @@ using System.IO;
using Vocaluxe.Base;
using System.Diagnostics;
using Vocaluxe.Lib.Song;
using Vocaluxe.Lib.Draw;
using System.Drawing;
using Vocaluxe.Menu;
namespace Vocaluxe.Base
{
@@ -13,25 +16,140 @@ namespace Vocaluxe.Base
{
private static CHelper Helper = new CHelper();
private static int _CurrentMusicStream = -1;
private static string _CurrentMusicFilePath = String.Empty;
private static List<string> _AllFileNames = new List<string>();
private static List<string> _NotPlayedFileNames = new List<string>();
private static List<string> _BGMusicFileNames = new List<string>();
private static int _PreviousMusicIndex = 0;
private static PlaylistElement _CurrentPlaylistElement = new PlaylistElement();
private static List<PlaylistElement> _AllFileNames = new List<PlaylistElement>();
private static List<PlaylistElement> _NotPlayedFileNames = new List<PlaylistElement>();
private static List<PlaylistElement> _BGMusicFileNames = new List<PlaylistElement>();
private static List<PlaylistElement> _PreviousFileNames = new List<PlaylistElement>();
private static int _Video = -1;
private static STexture _CurrentVideoTexture = new STexture(-1);
private static Stopwatch _FadeTimer = new Stopwatch();
private static bool _VideoEnabled;
private static bool _OwnMusicAdded;
private static bool _BackgroundMusicAdded;
private static bool _Playing;
private static bool _Disabled;
private static bool _CanSing;
public static bool VideoEnabled
{
get
{
return _VideoEnabled;
}
set
{
if (_VideoEnabled && value)
return;
if (!_VideoEnabled && !value)
return;
if(_VideoEnabled && !value)
ToggleVideo();
if (!_VideoEnabled && value)
ToggleVideo();
_VideoEnabled = value;
}
}
public static bool CanSing
{
get
{
return _CanSing;
}
set
{
_CanSing = value;
}
}
public static bool Disabled
{
get
{
return _Disabled;
}
set
{
_Disabled = value;
if (_Disabled)
Pause();
else
Play();
}
}
public static int SongID
{
get
{
return _CurrentPlaylistElement._SongID;
}
}
public static bool Duet
{
get
{
return _CurrentPlaylistElement.Duet;
}
}
public static bool SongHasVideo
{
get
{
return File.Exists(_CurrentPlaylistElement.VideoFilePath);
}
}
public static bool Playing
{
get
{
return _Playing;
}
}
public static string ArtistAndTitle
{
get
{
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
}
}
public static STexture Cover
{
get
{
return _CurrentPlaylistElement.Cover;
}
}
public static void Init()
{
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.mp3", true, true));
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wav", true, true));
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.ogg", true, true));
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wma", true, true));
List<string> templist = new List<string>();
foreach(string ending in CSettings.MusicFileTypes)
{
templist.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, ending, true, true));
}
foreach (string path in templist)
{
_BGMusicFileNames.Add(new PlaylistElement(path));
}
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
AddBackgroundMusic();
if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
_VideoEnabled = true;
_Playing = false;
}
@@ -46,24 +164,42 @@ namespace Vocaluxe.Base
{
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
CSound.Play(_CurrentMusicStream);
if (_VideoEnabled && _Video != -1)
CVideo.VdResume(_Video);
_Playing = true;
}
else
Next();
if (!IsBackgroundFile(_CurrentPlaylistElement))
_CanSing = true;
else
_CanSing = false;
}
}
}
public static void Stop()
{
if (_VideoEnabled && _Video != -1)
{
CVideo.VdClose(_Video);
CDraw.RemoveTexture(ref _CurrentVideoTexture);
_Video = -1;
}
CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
_CurrentMusicFilePath = String.Empty;
_CurrentPlaylistElement = new PlaylistElement();
_Playing = false;
}
public static void Pause()
{
if (_VideoEnabled && _Video != -1)
{
CVideo.VdPause(_Video);
CVideo.VdSkip(_Video, CSound.GetPosition(_CurrentMusicStream) + CSettings.BackgroundMusicFadeTime, _CurrentPlaylistElement.VideoGap);
}
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
_Playing = false;
}
@@ -83,15 +219,28 @@ namespace Vocaluxe.Base
{
if (_AllFileNames.Count > 0)
{
Stop();
if (_PreviousMusicIndex == _PreviousFileNames.Count - 1 || _PreviousFileNames.Count == 0) //We are not currently in the previous list
{
Stop();
if (_NotPlayedFileNames.Count == 0)
_NotPlayedFileNames.AddRange(_AllFileNames);
if (_NotPlayedFileNames.Count == 0)
_NotPlayedFileNames.AddRange(_AllFileNames);
_CurrentPlaylistElement = _NotPlayedFileNames[CGame.Rand.Next(_NotPlayedFileNames.Count)];
_NotPlayedFileNames.Remove(_CurrentPlaylistElement);
_CurrentMusicFilePath = _NotPlayedFileNames[CGame.Rand.Next(_NotPlayedFileNames.Count)];
_NotPlayedFileNames.Remove(_CurrentMusicFilePath);
_PreviousFileNames.Add(_CurrentPlaylistElement);
_PreviousMusicIndex = _PreviousFileNames.Count - 1;
}
else if(_PreviousFileNames.Count > 0) //We are in the previous list
{
Stop();
_PreviousMusicIndex++;
_CurrentMusicStream = CSound.Load(_CurrentMusicFilePath);
_CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex];
}
_CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath);
if (_VideoEnabled)
LoadVideo();
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
Play();
}
@@ -99,6 +248,36 @@ namespace Vocaluxe.Base
Stop();
}
public static void Previous()
{
if (_PreviousFileNames.Count > 0 || _PreviousMusicIndex >= 0)
{
Stop();
_PreviousMusicIndex--;
if (_PreviousMusicIndex < 0)
_PreviousMusicIndex = 0; //No previous songs left, so play the first
_CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex];
_CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath);
if (_VideoEnabled)
LoadVideo();
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
Play();
}
}
public static void Repeat()
{
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
{
CSound.SetPosition(_CurrentMusicStream, 0);
if (_VideoEnabled && _Video != -1)
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
}
}
public static void ApplyVolume()
{
CSound.SetStreamVolume(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
@@ -110,8 +289,8 @@ namespace Vocaluxe.Base
{
foreach (CSong song in CSongs.AllSongs)
{
_AllFileNames.Add(song.GetMP3());
_NotPlayedFileNames.Add(song.GetMP3());
_AllFileNames.Add(new PlaylistElement(song));
_NotPlayedFileNames.Add(new PlaylistElement(song));
}
}
_OwnMusicAdded = true;
@@ -128,7 +307,7 @@ namespace Vocaluxe.Base
_NotPlayedFileNames.AddRange(_BGMusicFileNames);
}
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
if (Playing && !IsBackgroundFile(_CurrentPlaylistElement) || _AllFileNames.Count == 0)
Next();
_OwnMusicAdded = false;
@@ -153,7 +332,7 @@ namespace Vocaluxe.Base
AddOwnMusic();
_BackgroundMusicAdded = false;
if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
if (Playing && IsBackgroundFile(_CurrentPlaylistElement) || _AllFileNames.Count == 0)
Next();
}
}
@@ -207,19 +386,232 @@ namespace Vocaluxe.Base
CConfig.SaveConfig();
}
public static bool IsPlaying()
public static void ToggleVideo()
{
return CSound.IsPlaying(_CurrentMusicStream);
if (_Video != -1)
{
if (_VideoEnabled)
{
_VideoEnabled = false;
CVideo.VdClose(_Video);
_Video = -1;
CDraw.RemoveTexture(ref _CurrentVideoTexture);
return;
}
if (CVideo.VdFinished(_Video))
{
CVideo.VdClose(_Video);
CDraw.RemoveTexture(ref _CurrentVideoTexture);
_Video = -1;
return;
}
}
else
LoadVideo();
}
private static bool IsBackgroundFile(string FilePath)
public static STexture GetVideoTexture()
{
foreach (string file in _BGMusicFileNames)
if (_Video != -1)
{
if (file == FilePath)
float vtime = 0f;
CVideo.VdGetFrame(_Video, ref _CurrentVideoTexture, CSound.GetPosition(_CurrentMusicStream), ref vtime);
if (_FadeTimer.ElapsedMilliseconds <= 3000L)
{
_CurrentVideoTexture.color.A = (_FadeTimer.ElapsedMilliseconds / 3000f);
}
else
{
_CurrentVideoTexture.color.A = 1f;
_FadeTimer.Stop();
}
return _CurrentVideoTexture;
}
return new STexture(-1);
}
private static bool IsBackgroundFile(PlaylistElement element)
{
foreach (PlaylistElement elements in _BGMusicFileNames)
{
if (elements.MusicFilePath == element.MusicFilePath)
return true;
}
return false;
}
private static void LoadVideo()
{
if (_Video == -1)
{
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
_VideoEnabled = true;
_FadeTimer.Reset();
_FadeTimer.Start();
}
}
}
}
class PlaylistElement
{
public int _SongID;
private string _MusicFilePath;
public string MusicFilePath
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.GetMP3();
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return _MusicFilePath;
}
set
{
_MusicFilePath = value;
}
}
public string VideoFilePath
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.GetVideo();
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return string.Empty;
}
}
public string Title
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.Title;
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return "Unknown";
}
}
public string Artist
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.Artist;
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return "Unknown";
}
}
public STexture Cover
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.CoverTextureSmall;
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return CCover.NoCover;
}
}
public float VideoGap
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.VideoGap;
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return 0;
}
}
public bool Duet
{
get
{
if (_SongID >= 0)
{
CSong song = CSongs.GetSong(_SongID);
if (song != null)
return song.IsDuet;
else
{
_SongID = -1;
CLog.LogError("Song not found");
}
}
return false;
}
}
public PlaylistElement(CSong song)
{
MusicFilePath = string.Empty;
_SongID = song.ID;
}
public PlaylistElement(string FilePath)
{
MusicFilePath = FilePath;
_SongID = -1;
}
public PlaylistElement()
{
MusicFilePath = string.Empty;
_SongID = -1;
}
}
+21 -2
View File
@@ -87,7 +87,8 @@ namespace Vocaluxe.Base
public enum ERecordLib
{
PortAudio
PortAudio,
DirectSound
}
public enum EVideoDecoder
@@ -167,6 +168,14 @@ namespace Vocaluxe.Base
TR_CONFIG_FADEPLAYERINFO_OFF
}
public enum ELyricStyle
{
Fill,
Jump,
Slide,
Zoom
}
#endregion Enums
static class CConfig
@@ -203,6 +212,7 @@ namespace Vocaluxe.Base
public static EPlayerInfo PlayerInfo = EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH;
public static EFadePlayerInfo FadePlayerInfo = EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_OFF;
public static ECoverLoading CoverLoading = ECoverLoading.TR_CONFIG_COVERLOADING_ATSTART;
public static ELyricStyle LyricStyle = ELyricStyle.Slide;
// Sound
public static EPlaybackLib PlayBackLib = EPlaybackLib.PortAudio;
@@ -230,10 +240,11 @@ namespace Vocaluxe.Base
public static EOffOn VideoBackgrounds = EOffOn.TR_CONFIG_ON;
public static EOffOn VideoPreview = EOffOn.TR_CONFIG_ON;
public static EOffOn VideosInSongs = EOffOn.TR_CONFIG_ON;
public static EOffOn VideosToBackground = EOffOn.TR_CONFIG_OFF;
// Record
public static SMicConfig[] MicConfig;
public static int MicDelay = 200; //[ms]
public static int MicDelay = 300; //[ms]
//Lists to save parameters and values
private static List<string> _Params = new List<string>();
@@ -321,6 +332,7 @@ namespace Vocaluxe.Base
CHelper.TryGetEnumValueFromXML("//root/Theme/PlayerInfo", navigator, ref PlayerInfo);
CHelper.TryGetEnumValueFromXML("//root/Theme/FadePlayerInfo", navigator, ref FadePlayerInfo);
CHelper.TryGetEnumValueFromXML("//root/Theme/CoverLoading", navigator, ref CoverLoading);
CHelper.TryGetEnumValueFromXML("//root/Theme/LyricStyle", navigator, ref LyricStyle);
#endregion Theme
#region Sound
@@ -403,6 +415,7 @@ namespace Vocaluxe.Base
CHelper.TryGetEnumValueFromXML<EOffOn>("//root/Video/VideoBackgrounds", navigator, ref VideoBackgrounds);
CHelper.TryGetEnumValueFromXML<EOffOn>("//root/Video/VideoPreview", navigator, ref VideoPreview);
CHelper.TryGetEnumValueFromXML<EOffOn>("//root/Video/VideosInSongs", navigator, ref VideosInSongs);
CHelper.TryGetEnumValueFromXML<EOffOn>("//root/Video/VideosToBackground", navigator, ref VideosToBackground);
#endregion Video
#region Record
@@ -531,6 +544,9 @@ namespace Vocaluxe.Base
writer.WriteComment("Cover Loading:" + ListStrings(Enum.GetNames(typeof(ECoverLoading))));
writer.WriteElementString("CoverLoading", Enum.GetName(typeof(ECoverLoading), CoverLoading));
writer.WriteComment("Lyric Style:" + ListStrings(Enum.GetNames(typeof(ELyricStyle))));
writer.WriteElementString("LyricStyle", Enum.GetName(typeof(ELyricStyle), LyricStyle));
writer.WriteEndElement();
#endregion Theme
@@ -635,6 +651,9 @@ namespace Vocaluxe.Base
writer.WriteComment("Show Videos while singing: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideosInSongs", Enum.GetName(typeof(EOffOn), VideosInSongs));
writer.WriteComment("Show backgroundmusic videos as background: " + ListStrings(Enum.GetNames(typeof(EOffOn))));
writer.WriteElementString("VideosToBackground", Enum.GetName(typeof(EOffOn), VideosToBackground));
writer.WriteEndElement();
#endregion Video
+13
View File
@@ -239,6 +239,19 @@ namespace Vocaluxe.Base
_Draw.DrawTexture(Texture, rect, color, begin, end);
}
public static void DrawTexture(CStatic StaticBounds, STexture Texture, EAspect Aspect)
{
RectangleF bounds = new RectangleF(StaticBounds.Rect.X, StaticBounds.Rect.Y, StaticBounds.Rect.W, StaticBounds.Rect.H);
RectangleF rect = new RectangleF(0f, 0f, Texture.width, Texture.height);
if (rect.Height <= 0f)
return;
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, Aspect);
DrawTexture(Texture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, StaticBounds.Rect.Z),
Texture.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false);
}
public static void DrawTextureReflection(STexture Texture, SRectF rect, SColorF color, SRectF bounds, float space, float height)
{
_Draw.DrawTextureReflection(Texture, rect, color, bounds, space, height);
+38 -11
View File
@@ -16,6 +16,8 @@ namespace Vocaluxe.Base
public string Name;
public EGameDifficulty Difficulty;
public double Points;
public double PointsLineBonus;
public double PointsGoldenNotes;
public int NoteDiff;
public int LineNr;
public List<CLine> SingLine;
@@ -215,6 +217,8 @@ namespace Vocaluxe.Base
for (int i = 0; i < _Player.Length; i++)
{
_Player[i].Points = 0f;
_Player[i].PointsLineBonus = 0f;
_Player[i].PointsGoldenNotes = 0f;
_Player[i].LineNr = 0;
_Player[i].NoteDiff = 0;
_Player[i].SingLine = new List<CLine>();
@@ -249,7 +253,7 @@ namespace Vocaluxe.Base
CSound.AnalyzeBuffer(p);
}
if (_OldBeatD == _CurrentBeatD)
if (_OldBeatD >= _CurrentBeatD)
return;
for (int p = 0; p < _NumPlayer; p++)
@@ -323,8 +327,12 @@ namespace Vocaluxe.Base
if (_Player[p].NoteDiff <= (2 - (int)_Player[p].Difficulty))
{
// valid
CSound.RecordSetTone(p, Tone);
_Player[p].Points += (CSettings.MaxScore - CSettings.LinebonusScore) * (double)notes[Note].PointsForBeat / (double)song.Notes.GetLines(_Player[p].LineNr).Points;
//CSound.RecordSetTone(p, Tone);
double points = (CSettings.MaxScore - CSettings.LinebonusScore) * (double)notes[Note].PointsForBeat / (double)song.Notes.GetLines(_Player[p].LineNr).Points;
if (notes[Note].NoteType == ENoteType.Golden)
_Player[p].PointsGoldenNotes += points;
_Player[p].Points += points;
// update player notes (sung notes)
if (_Player[p].SingLine[Line].NoteCount > 0)
@@ -344,11 +352,6 @@ namespace Vocaluxe.Base
_Player[p].SingLine[Line].LastNote.IsPerfect(notes[Note]);
_Player[p].SingLine[Line].IsPerfect(lines[Line]);
if (_Player[p].SingLine[Line].PerfectLine)
{
_Player[p].Points += CSettings.LinebonusScore * (double)lines[Line].Points / (double)song.Notes.GetPoints(_Player[p].LineNr);
}
}
else
{
@@ -356,7 +359,7 @@ namespace Vocaluxe.Base
{
CNote nt = _Player[p].SingLine[Line].LastNote;
if (nt.EndBeat + 1 != beat || nt.Hit)
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, notes[Note].NoteType));
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
else
{
if (nt.Tone == TonePlayer && nt.EndBeat + 1 == beat)
@@ -365,17 +368,41 @@ namespace Vocaluxe.Base
}
else
{
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, notes[Note].NoteType));
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
}
}
}
else
{
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, notes[Note].NoteType));
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
}
}
}
// Line Bonus
int NumLinesWithPoints = song.Notes.GetNumLinesWithPoints(_Player[p].LineNr);
if (Note == lines[Line].NoteCount - 1 && NumLinesWithPoints > 0)
{
if (notes[Note].EndBeat == beat && lines[Line].Points > 0f)
{
double factor = (double)_Player[p].SingLine[Line].Points / (double)lines[Line].Points;
if (factor < 0.4)
factor = 0.0;
else if (factor > 0.9)
factor = 1.0;
else
{
factor -= 0.4;
factor *= 2;
factor *= factor;
}
double points = CSettings.LinebonusScore * factor * 1f / NumLinesWithPoints;
_Player[p].Points += points;
_Player[p].PointsLineBonus += points;
}
}
}
}
+6 -1
View File
@@ -47,7 +47,7 @@ namespace Vocaluxe.Base
public const int iVersionSub = 0; // patches
public const ERevision VersionRevision = ERevision.Alpha;
public const int iBuild = 62; // Increase on every published version! Never Reset!
public const int iBuild = 63; // Increase on every published version! Never Reset!
public const int iDatabaseHighscoreVersion = 1;
public const int iDatabaseCoverVersion = 1;
@@ -115,6 +115,11 @@ namespace Vocaluxe.Base
public static bool TabNavigation = false;
public const float BackgroundMusicFadeTime = 0.5f;
public static List<string> MusicFileTypes = new List<string>()
{
"*.mp3","*.wma","*.ogg","*.wav"
};
public static string GetVersionText()
{
+100 -70
View File
@@ -181,6 +181,9 @@ namespace Vocaluxe.Base
case ERecordLib.PortAudio:
_Record = new CPortAudioRecord();
break;
case ERecordLib.DirectSound:
_Record = new CDirectSoundRecord();
break;
default:
_Record = new CPortAudioRecord();
@@ -237,6 +240,16 @@ namespace Vocaluxe.Base
return _Record.GetMaxVolume(Player);
}
public static int NumHalfTones(int Player)
{
return _Record.NumHalfTones(Player);
}
public static float[] ToneWeigth(int Player)
{
return _Record.ToneWeigth(Player);
}
public static SRecordDevice[] RecordGetDevices()
{
SRecordDevice[] devices = _Record.RecordDevices();
@@ -281,9 +294,10 @@ namespace Vocaluxe.Base
class CBuffer
{
private const double BaseToneFreq = 65.4064;
private const int NumHalfTones = 47;
private const double _BaseToneFreq = 65.4064;
private const int _NumHalfTones = 47;
private float[] _ToneWeigth;
private Int16[] _AnalysisBuffer = new Int16[4096];
private Object _AnalysisBufferLock = new Object();
@@ -291,10 +305,22 @@ namespace Vocaluxe.Base
private int _Tone = 0;
private int _ToneAbs = 0;
private double _MaxVolume = 0.0;
private bool _NewSamples = false;
private bool _NewSamples;
private MemoryStream _Stream; // full buffer
public CBuffer()
{
_ToneWeigth = new float[_NumHalfTones];
_Stream = new MemoryStream();
_NewSamples = false;
}
public int NumHalfTones
{
get { return _NumHalfTones; }
}
public int ToneAbs
{
get
@@ -346,11 +372,6 @@ namespace Vocaluxe.Base
}
}
public CBuffer()
{
_Stream = new MemoryStream();
}
public long Length
{
get { return _Stream.Length; }
@@ -361,6 +382,17 @@ namespace Vocaluxe.Base
get { return _Stream.ToArray(); }
}
public float[] ToneWeigth
{
get
{
lock (_AnalysisBufferLock)
{
return _ToneWeigth;
}
}
}
public void Reset()
{
_Stream.SetLength(0L);
@@ -386,39 +418,8 @@ namespace Vocaluxe.Base
//if (assigned(fVoiceStream)) then
//fVoiceStream.WriteData(Buffer, BufferSize);
int BufferOffset = 0;
int SampleCount = (int)Math.Floor(buffer.Length / 2.0);
if (SampleCount > _AnalysisBuffer.Length)
{
BufferOffset = (SampleCount - _AnalysisBuffer.Length) * 2;
SampleCount = _AnalysisBuffer.Length;
}
lock (_AnalysisBufferLock)
{
try
{
// move old samples to the beginning of the array (if necessary)
for (int i = 0; i < _AnalysisBuffer.Length - SampleCount; i++)
{
_AnalysisBuffer[i] = _AnalysisBuffer[i + SampleCount];
}
byte[] b = new byte[2];
// copy new samples to analysis buffer
for (int i = 0; i < SampleCount; i++)
{
b[0] = buffer[BufferOffset + i * 2];
b[1] = buffer[BufferOffset + i * 2 + 1];
_AnalysisBuffer[_AnalysisBuffer.Length - SampleCount + i] = BitConverter.ToInt16(b, 0);
}
}
catch (Exception)
{
}
Add(buffer);
_NewSamples = true;
}
@@ -426,69 +427,98 @@ namespace Vocaluxe.Base
public void AnalyzeBuffer()
{
if (!_NewSamples)
return;
lock (_AnalysisBufferLock)
{
if (!_NewSamples)
return;
try
int len = _AnalysisBuffer.Length * 2;
if (_Stream.Length >= len)
{
// find maximum volume
_MaxVolume = 0;
for (int i = 0; i < _AnalysisBuffer.Length/4; i++)
{
float Volume = Math.Abs((float)_AnalysisBuffer[i]) / (float)Int16.MaxValue;
if (Volume > MaxVolume)
_MaxVolume = Volume;
}
byte[] buf = new byte[len];
_Stream.Position -= len;
_Stream.Read(buf, 0, len);
if (_MaxVolume >= 0.05f)
byte[] b = new byte[2];
for (int i = 0; i < _AnalysisBuffer.Length; i++)
{
// analyse the current voice pitch
AnalyzeByAutocorrelation();
_ToneValid = true;
}
else
_ToneValid = false;
b[0] = buf[i * 2];
b[1] = buf[i * 2 + 1];
_NewSamples = false;
_AnalysisBuffer[i] = BitConverter.ToInt16(b, 0);
}
}
catch (Exception)
_NewSamples = false;
}
try
{
// find maximum volume
_MaxVolume = 0;
for (int i = 0; i < _AnalysisBuffer.Length / 4; i++)
{
float Volume = Math.Abs((float)_AnalysisBuffer[i]) / (float)Int16.MaxValue;
if (Volume > MaxVolume)
_MaxVolume = Volume;
}
if (_MaxVolume >= 0.02f)
AnalyzeByAutocorrelation(true);
else
AnalyzeByAutocorrelation(false);
}
catch (Exception)
{
}
}
private void AnalyzeByAutocorrelation()
private void AnalyzeByAutocorrelation(bool valid)
{
const double HalftoneBase = 1.05946309436; // 2^(1/12) -> HalftoneBase^12 = 2 (one octave)
// prepare to analyze
double MaxWeight = -1.0;
int MaxTone = 0;
double MinWeight = 1.0;
int MaxTone = -1;
float[] Weigth = new float[_NumHalfTones];
// analyze halftones
// Note: at the lowest tone (~65Hz) and a buffer-size of 4096
// at 44.1 (or 48kHz) only 6 (or 5) samples are compared, this might be
// too few samples -> use a bigger buffer-size
for (int ToneIndex = 0; ToneIndex < NumHalfTones; ToneIndex++)
for (int ToneIndex = 0; ToneIndex < _NumHalfTones; ToneIndex++)
{
double CurFreq = BaseToneFreq * Math.Pow(HalftoneBase, ToneIndex);
double CurFreq = _BaseToneFreq * Math.Pow(HalftoneBase, ToneIndex);
double CurWeight = AnalyzeAutocorrelationFreq(CurFreq);
// TODO: prefer higher frequencies (use >= or use downto)
if (CurWeight > MaxWeight /* && (Math.Abs(ToneIndex - _ToneAbs) < 5 || _ToneAbs == 0)*/)
if (CurWeight > MaxWeight)
{
// this frequency has a higher weight
MaxWeight = CurWeight;
MaxTone = ToneIndex;
}
if (CurWeight < MinWeight)
MinWeight = CurWeight;
Weigth[ToneIndex] = (float)CurWeight;
}
_ToneAbs = MaxTone;
_Tone = MaxTone % 12;
if (valid && MaxWeight - MinWeight > 0.01)
{
for (int i = 0; i < Weigth.Length; i++)
{
_ToneWeigth[i] = Weigth[i];
}
_ToneAbs = MaxTone;
_Tone = MaxTone % 12;
_ToneValid = true;
}
else
_ToneValid = false;
}
private double AnalyzeAutocorrelationFreq(double Freq)
+7 -1
View File
@@ -22,7 +22,9 @@ namespace Vocaluxe.GameModes
_Rounds[round, player].ProfileID = Player[player].ProfileID;
_Rounds[round, player].Name = Player[player].Name;
_Rounds[round, player].Difficulty = Player[player].Difficulty;
_Rounds[round, player].Points = 0;
_Rounds[round, player].Points = 0f;
_Rounds[round, player].PointsGoldenNotes = 0f;
_Rounds[round, player].PointsLineBonus = 0f;
_Rounds[round, player].Medley = false;
_Rounds[round, player].Duet = false;
_Rounds[round, player].SongFinished = false;
@@ -38,6 +40,8 @@ namespace Vocaluxe.GameModes
_Rounds[Round, player].SongID = SongID;
_Rounds[Round, player].LineNr = Player[player].LineNr;
_Rounds[Round, player].Points = Player[player].Points;
_Rounds[Round, player].PointsGoldenNotes = Player[player].PointsGoldenNotes;
_Rounds[Round, player].PointsLineBonus = Player[player].PointsLineBonus;
_Rounds[Round, player].Medley = Medley;
_Rounds[Round, player].Duet = Duet;
_Rounds[Round, player].DateTicks = DateTicks;
@@ -68,6 +72,8 @@ namespace Vocaluxe.GameModes
{
player[p].Name = _Rounds[Round, p].Name;
player[p].Points = _Rounds[Round, p].Points;
player[p].PointsGoldenNotes = _Rounds[Round, p].PointsGoldenNotes;
player[p].PointsLineBonus = _Rounds[Round, p].PointsLineBonus;
player[p].SongID = _Rounds[Round, p].SongID;
player[p].LineNr = _Rounds[Round, p].LineNr;
player[p].Difficulty = _Rounds[Round, p].Difficulty;
+22
View File
@@ -33,6 +33,14 @@ namespace Vocaluxe.Lib.Song
return _Lines[Index].Points;
}
public int GetNumLinesWithPoints(int Index)
{
if (Index >= _Lines.Count)
return 0;
return _Lines[Index].NumLinesWithPoints;
}
public void AddLines(CLines Lines)
{
_Lines.Add(Lines);
@@ -545,6 +553,20 @@ namespace Vocaluxe.Lib.Song
}
}
public int NumLinesWithPoints
{
get
{
int num = 0;
foreach (CLine line in _Lines)
{
if (line.Points > 0f)
num++;
}
return num;
}
}
#region Methods
public void AddLine(CLine Line)
{
+5
View File
@@ -121,6 +121,11 @@ namespace Vocaluxe.Lib.Song
return Path.Combine(Folder, MP3FileName);
}
public string GetVideo()
{
return Path.Combine(Folder, VideoFileName);
}
public bool ReadTXTSong(string FilePath)
{
if (!File.Exists(FilePath))
+437
View File
@@ -0,0 +1,437 @@
using System;
using System.Collections.Generic;
using System.Threading;
using SlimDX.DirectSound;
using SlimDX.Multimedia;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Sound
{
class CDirectSoundRecord : IRecord
{
private bool _initialized = false;
private List<SRecordDevice> _Devices = null;
private SRecordDevice[] _DeviceConfig = null;
private List<SoundCardSource> _Sources = null;
private CBuffer[] _Buffer;
public CDirectSoundRecord()
{
_Buffer = new CBuffer[CSettings.MaxNumPlayer];
for (int i = 0; i < _Buffer.Length; i++)
{
_Buffer[i] = new CBuffer();
}
Init();
}
public bool Init()
{
DeviceCollection devices = DirectSoundCapture.GetDevices();
_Devices = new List<SRecordDevice>();
_Sources = new List<SoundCardSource>();
int id = 0;
foreach (DeviceInformation dev in devices)
{
DirectSoundCapture ds = new DirectSoundCapture(dev.DriverGuid);
SRecordDevice device = new SRecordDevice();
device.Driver = dev.DriverGuid.ToString();
device.ID = id;
device.Name = dev.Description;
device.Inputs = new List<SInput>();
SInput inp = new SInput();
inp.Name = "Default";
inp.Channels = ds.Capabilities.Channels;
if (inp.Channels > 2)
inp.Channels = 2; //more are not supported in vocaluxe
device.Inputs.Add(inp);
_Devices.Add(device);
id++;
ds.Dispose();
}
_DeviceConfig = _Devices.ToArray();
_initialized = true;
return true;
}
public void CloseAll()
{
if (_initialized)
{
foreach (SoundCardSource source in _Sources)
{
source.Stop();
source.Dispose();
}
_initialized = false;
}
//System.IO.File.WriteAllBytes("test0.raw", _Buffer[0].Buffer);
}
public bool Start(SRecordDevice[] DeviceConfig)
{
if (!_initialized)
return false;
for (int i = 0; i < _Buffer.Length; i++)
{
_Buffer[i].Reset();
}
_DeviceConfig = DeviceConfig;
bool[] active = new bool[DeviceConfig.Length];
Guid[] guid = new Guid[DeviceConfig.Length];
short[] channels = new short[DeviceConfig.Length];
for (int dev = 0; dev < DeviceConfig.Length; dev++)
{
active[dev] = false;
for (int inp = 0; inp < DeviceConfig[dev].Inputs.Count; inp++)
{
if (DeviceConfig[dev].Inputs[inp].PlayerChannel1 > 0 ||
DeviceConfig[dev].Inputs[inp].PlayerChannel2 > 0)
active[dev] = true;
guid[dev] = new Guid(DeviceConfig[dev].Driver);
channels[dev] = (short)DeviceConfig[dev].Inputs[0].Channels;
}
}
for (int i = 0; i < _Devices.Count; i++)
{
if (active[i])
{
SoundCardSource source = new SoundCardSource(guid[i], channels[i]);
source.SampleRateKHz = 44.1;
source.SampleDataReady += this.OnDataReady;
source.Start();
_Sources.Add(source);
}
}
_DeviceConfig = DeviceConfig;
return true;
}
public bool Stop()
{
if (!_initialized)
return false;
foreach (SoundCardSource source in _Sources)
{
source.Stop();
}
return true;
}
public void AnalyzeBuffer(int Player)
{
if (!_initialized)
return;
_Buffer[Player].AnalyzeBuffer();
}
public int GetToneAbs(int Player)
{
if (!_initialized)
return 0;
return _Buffer[Player].ToneAbs;
}
public int GetTone(int Player)
{
if (!_initialized)
return 0;
return _Buffer[Player].Tone;
}
public void SetTone(int Player, int Tone)
{
if (!_initialized)
return;
_Buffer[Player].Tone = Tone;
}
public float GetMaxVolume(int Player)
{
if (!_initialized)
return 0f;
return _Buffer[Player].MaxVolume;
}
public bool ToneValid(int Player)
{
if (!_initialized)
return false;
return _Buffer[Player].ToneValid;
}
public SRecordDevice[] RecordDevices()
{
if (!_initialized)
return null;
if (_Devices.Count == 0)
return null;
return _Devices.ToArray();
}
public int NumHalfTones(int Player)
{
if (!_initialized)
return 0;
return _Buffer[Player].NumHalfTones;
}
public float[] ToneWeigth(int Player)
{
if (!_initialized)
return null;
return _Buffer[Player].ToneWeigth;
}
private void OnDataReady(object sender, SampleDataEventArgs e)
{
if (_initialized)
{
byte[] _leftBuffer = new byte[e.Data.Length / 2];
byte[] _rightBuffer = new byte[e.Data.Length / 2];
//[]: Sample, L: Left channel R: Right channel
//[LR][LR][LR][LR][LR][LR]
//The data is interleaved and needs to be demultiplexed
for (int i = 0; i < e.Data.Length / 2; i++)
{
_leftBuffer[i] = e.Data[i * 2 - (i % 2)];
_rightBuffer[i] = e.Data[i * 2 - (i % 2) + 2];
}
for (int i = 0; i < _DeviceConfig.Length; i++)
{
if (_DeviceConfig[i].Driver == e.Guid.ToString())
{
if (_DeviceConfig[i].Inputs[0].PlayerChannel1 > 0)
_Buffer[_DeviceConfig[i].Inputs[0].PlayerChannel1 - 1].ProcessNewBuffer(_leftBuffer);
if (_DeviceConfig[i].Inputs[0].PlayerChannel2 > 0)
_Buffer[_DeviceConfig[i].Inputs[0].PlayerChannel2 - 1].ProcessNewBuffer(_rightBuffer);
}
}
}
}
public class SampleDataEventArgs : EventArgs
{
public SampleDataEventArgs(byte[] data, Guid guid)
{
this.Data = data;
this.Guid = guid;
}
public byte[] Data { get; private set; }
public Guid Guid { get; private set; }
}
public class SoundCardSource : IDisposable
{
private volatile bool running;
private int bufferSize;
private CaptureBuffer buffer;
private CaptureBufferDescription bufferDescription;
private DirectSoundCapture captureDevice;
private WaveFormat waveFormat;
private Thread captureThread;
private List<NotificationPosition> notifications;
private int bufferPortionCount;
private int bufferPortionSize;
private WaitHandle[] waitHandles;
private double sampleRate;
private Guid guid;
private short channels;
public SoundCardSource(Guid guid, short channels)
{
this.guid = guid;
this.channels = channels;
this.waveFormat = new WaveFormat();
this.SampleRateKHz = 44.1;
this.bufferSize = 2048;
}
public event EventHandler<SampleDataEventArgs> SampleDataReady = delegate { };
public double SampleRateKHz
{
get
{
return this.sampleRate;
}
set
{
this.sampleRate = value;
if (this.running)
{
this.Restart();
}
}
}
public void Start()
{
if (this.running)
{
throw new InvalidOperationException();
}
if (this.captureDevice == null)
{
this.captureDevice = new DirectSoundCapture(guid);
}
this.waveFormat.FormatTag = WaveFormatTag.Pcm; // Change to WaveFormatTag.IeeeFloat for float
this.waveFormat.BitsPerSample = 16; // Set this to 32 for float
this.waveFormat.BlockAlignment = (short)(channels * (waveFormat.BitsPerSample / 8));
this.waveFormat.Channels = this.channels;
this.waveFormat.SamplesPerSecond = (int)(this.SampleRateKHz * 1000D);
this.waveFormat.AverageBytesPerSecond =
this.waveFormat.SamplesPerSecond *
this.waveFormat.BlockAlignment;
this.bufferPortionCount = 2;
this.bufferDescription.BufferBytes = this.bufferSize * sizeof(short) * bufferPortionCount * this.channels;
this.bufferDescription.Format = this.waveFormat;
this.bufferDescription.WaveMapped = false;
this.buffer = new CaptureBuffer(this.captureDevice, this.bufferDescription);
this.bufferPortionSize = this.buffer.SizeInBytes / this.bufferPortionCount;
this.notifications = new List<NotificationPosition>();
for (int i = 0; i < this.bufferPortionCount; i++)
{
NotificationPosition notification = new NotificationPosition();
notification.Offset = this.bufferPortionCount - 1 + (bufferPortionSize * i);
notification.Event = new AutoResetEvent(false);
this.notifications.Add(notification);
}
this.buffer.SetNotificationPositions(this.notifications.ToArray());
this.waitHandles = new WaitHandle[this.notifications.Count];
for (int i = 0; i < this.notifications.Count; i++)
{
this.waitHandles[i] = this.notifications[i].Event;
}
this.captureThread = new Thread(new ThreadStart(this.CaptureThread));
this.captureThread.IsBackground = true;
this.running = true;
this.captureThread.Start();
}
public void Stop()
{
this.running = false;
if (this.captureThread != null)
{
this.captureThread.Join();
this.captureThread = null;
}
if (this.buffer != null)
{
this.buffer.Dispose();
this.buffer = null;
}
if (this.notifications != null)
{
for (int i = 0; i < this.notifications.Count; i++)
{
this.notifications[i].Event.Close();
}
this.notifications.Clear();
this.notifications = null;
}
}
public void Restart()
{
this.Stop();
this.Start();
}
private void CaptureThread()
{
int bufferPortionSamples = this.bufferPortionSize / sizeof(byte);
// Buffer type must match this.waveFormat.FormatTag and this.waveFormat.BitsPerSample
byte[] bufferPortion = new byte[bufferPortionSamples];
int bufferPortionIndex;
this.buffer.Start(true);
while (this.running)
{
bufferPortionIndex = WaitHandle.WaitAny(this.waitHandles);
this.buffer.Read(
bufferPortion,
0,
bufferPortionSamples,
bufferPortionSize * Math.Abs((bufferPortionIndex - 1) % bufferPortionCount));
this.SampleDataReady(this, new SampleDataEventArgs(bufferPortion, guid));
}
this.buffer.Stop();
}
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
this.Stop();
if (this.captureDevice != null)
{
this.captureDevice.Dispose();
this.captureDevice = null;
}
}
}
}
}
}
+28 -2
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
@@ -90,6 +91,7 @@ namespace Vocaluxe.Lib.Sound
CLog.LogError("Error initializing PortAudio: " + e.Message);
return false;
}
return true;
}
@@ -103,6 +105,15 @@ namespace Vocaluxe.Lib.Sound
if (!_initialized)
return false;
if (DeviceConfig == null)
return false;
if (_recHandle == null)
return false;
if (_recHandle.Length == 0)
return false;
for (int i = 0; i < _Buffer.Length; i++)
{
_Buffer[i].Reset();
@@ -142,7 +153,7 @@ namespace Vocaluxe.Lib.Sound
ref inputParams,
IntPtr.Zero,
44100,
PortAudio.paFramesPerBufferUnspecified,
882,
PortAudio.PaStreamFlags.paNoFlag,
_myRecProc,
new IntPtr(i))))
@@ -152,7 +163,6 @@ namespace Vocaluxe.Lib.Sound
return false;
}
}
return result;
}
@@ -240,6 +250,22 @@ namespace Vocaluxe.Lib.Sound
return _Buffer[Player].ToneValid;
}
public int NumHalfTones(int Player)
{
if (!_initialized)
return 0;
return _Buffer[Player].NumHalfTones;
}
public float[] ToneWeigth(int Player)
{
if (!_initialized)
return null;
return _Buffer[Player].ToneWeigth;
}
public SRecordDevice[] RecordDevices()
{
if (!_initialized)
+2
View File
@@ -51,6 +51,8 @@ namespace Vocaluxe.Lib.Sound
void SetTone(int Player, int Tone);
float GetMaxVolume(int Player);
bool ToneValid(int Player);
int NumHalfTones(int Player);
float[] ToneWeigth(int Player);
SRecordDevice[] RecordDevices();
}
+24 -1
View File
@@ -137,8 +137,16 @@ namespace Vocaluxe.Menu
public bool Draw()
{
bool ok = false;
if (_Theme.Type == EBackgroundTypes.Video && CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
if (_Theme.Type == EBackgroundTypes.Video && CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON && CBackgroundMusic.Playing && CBackgroundMusic.SongHasVideo && CBackgroundMusic.VideoEnabled && !CBackgroundMusic.Disabled)
{
Pause();
ok = DrawBackgroundMusicVideo();
}
else if (_Theme.Type == EBackgroundTypes.Video && CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON)
{
Resume();
ok = DrawVideo();
}
if (_Theme.TextureName != String.Empty &&
(_Theme.Type == EBackgroundTypes.Texture ||
@@ -206,6 +214,21 @@ namespace Vocaluxe.Menu
}
return false;
}
private bool DrawBackgroundMusicVideo()
{
STexture VideoTexture = CBackgroundMusic.GetVideoTexture();
if (VideoTexture.height > 0)
{
RectangleF bounds = new RectangleF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH);
RectangleF rect = new RectangleF(0f, 0f, VideoTexture.width, VideoTexture.height);
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
CDraw.DrawTexture(VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.zFar / 4));
return true;
}
return false;
}
#endregion internal
#region ThemeEdit
+3 -1
View File
@@ -41,6 +41,7 @@ namespace Vocaluxe.Menu
public float SReflectionHeight;
private bool _Selected;
public bool Pressed;
public bool Selected
{
get { return _Selected; }
@@ -234,7 +235,8 @@ namespace Vocaluxe.Menu
return;
STexture texture = new STexture(-1);
if (!Selected)
if (!Selected && !Pressed)
{
texture = CTheme.GetSkinTexture(_Theme.TextureName);
CDraw.DrawTexture(texture, Rect, Color);
+144 -59
View File
@@ -36,6 +36,13 @@ namespace Vocaluxe.Menu
ScreenNull = -1
}
enum EPopupScreens
{
PopupPlayerControl = 0,
NoPopup = -1
}
class CCursor
{
private Stopwatch _CursorFadingTimer;
@@ -185,11 +192,12 @@ namespace Vocaluxe.Menu
private static float _GlobalAlpha;
private static float _ZOffset;
private static EScreens ActualScreen;
private static EScreens NextScreen;
private static EScreens _CurrentScreen;
private static EScreens _NextScreen;
private static EPopupScreens _CurrentPopupScreen;
private static List<CMenu> ScreenList = new List<CMenu>();
private static CMenu[] Screens;
private static List<CMenu> _Screens = new List<CMenu>();
private static List<CMenu> _PopupScreens = new List<CMenu>();
public static float GlobalAlpha
{
@@ -206,28 +214,31 @@ namespace Vocaluxe.Menu
{
// Add Screens, must be the same order as in EScreens!
CLog.StartBenchmark(1, "Build Screen List");
ScreenList.Add(new CScreenTest());
ScreenList.Add(new CScreenLoad());
ScreenList.Add(new CScreenMain());
ScreenList.Add(new CScreenSong());
ScreenList.Add(new CScreenOptions());
ScreenList.Add(new CScreenSing());
ScreenList.Add(new CScreenProfiles());
ScreenList.Add(new CScreenScore());
ScreenList.Add(new CScreenHighscore());
ScreenList.Add(new CScreenOptionsGame());
ScreenList.Add(new CScreenOptionsSound());
ScreenList.Add(new CScreenOptionsRecord());
ScreenList.Add(new CScreenOptionsVideo());
ScreenList.Add(new CScreenOptionsTheme());
ScreenList.Add(new CScreenNames());
ScreenList.Add(new CScreenCredits());
CLog.StopBenchmark(1, "Build Screen List");
Screens = ScreenList.ToArray();
_Screens.Add(new CScreenTest());
_Screens.Add(new CScreenLoad());
_Screens.Add(new CScreenMain());
_Screens.Add(new CScreenSong());
_Screens.Add(new CScreenOptions());
_Screens.Add(new CScreenSing());
_Screens.Add(new CScreenProfiles());
_Screens.Add(new CScreenScore());
_Screens.Add(new CScreenHighscore());
_Screens.Add(new CScreenOptionsGame());
_Screens.Add(new CScreenOptionsSound());
_Screens.Add(new CScreenOptionsRecord());
_Screens.Add(new CScreenOptionsVideo());
_Screens.Add(new CScreenOptionsTheme());
_Screens.Add(new CScreenNames());
_Screens.Add(new CScreenCredits());
_PopupScreens.Add(new CPopupScreenPlayerControl());
CLog.StopBenchmark(1, "Build Screen List");
ActualScreen = EScreens.ScreenLoad;
NextScreen = EScreens.ScreenNull;
_CurrentScreen = EScreens.ScreenLoad;
_NextScreen = EScreens.ScreenNull;
_CurrentPopupScreen = EPopupScreens.NoPopup;
_FadingTimer = new Stopwatch();
_GlobalAlpha = 1f;
@@ -247,50 +258,65 @@ namespace Vocaluxe.Menu
CTheme.Cursor.h,
CSettings.zNear);
for (int i = 0; i < Screens.Length; i++)
for (int i = 0; i < _Screens.Count; i++)
{
CLog.StartBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
Screens[i].LoadTheme();
_Screens[i].LoadTheme();
CLog.StopBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].LoadTheme();
}
}
public static void ReloadTheme()
{
ReloadCursor();
for (int i = 0; i < Screens.Length; i++)
for (int i = 0; i < _Screens.Count; i++)
{
Screens[i].ReloadTheme();
_Screens[i].ReloadTheme();
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].ReloadTheme();
}
}
public static void ReloadSkin()
{
ReloadCursor();
for (int i = 0; i < Screens.Length; i++)
for (int i = 0; i < _Screens.Count; i++)
{
Screens[i].ReloadTextures();
_Screens[i].ReloadTextures();
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].ReloadTextures();
}
}
public static void SaveTheme()
{
CTheme.SaveTheme();
for (int i = 0; i < Screens.Length; i++)
for (int i = 0; i < _Screens.Count; i++)
{
Screens[i].SaveTheme();
_Screens[i].SaveTheme();
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].SaveTheme();
}
}
public static void InitFirstScreen()
{
Screens[(int)ActualScreen].OnShow();
Screens[(int)ActualScreen].OnShowFinish();
}
public static CMenu GetScreen(int Index)
{
return Screens[Index];
_Screens[(int)_CurrentScreen].OnShow();
_Screens[(int)_CurrentScreen].OnShowFinish();
}
public static bool UpdateGameLogic(CKeys Keys, CMouse Mouse)
@@ -304,7 +330,7 @@ namespace Vocaluxe.Menu
CSound.Update();
CBackgroundMusic.Update();
if (CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_DYNAMIC && ActualScreen != EScreens.ScreenSing)
if (CConfig.CoverLoading == ECoverLoading.TR_CONFIG_COVERLOADING_DYNAMIC && _CurrentScreen != EScreens.ScreenSing)
CSongs.LoadCover(30L, 1);
if (CSettings.GameState != EGameState.EditTheme)
@@ -323,12 +349,13 @@ namespace Vocaluxe.Menu
public static bool Draw()
{
if ((NextScreen != EScreens.ScreenNull) && !_Fading)
if ((_NextScreen != EScreens.ScreenNull) && !_Fading)
{
_Fading = true;
_FadingTimer.Reset();
_FadingTimer.Start();
Screens[(int)NextScreen].OnShow();
_Screens[(int)_NextScreen].OnShow();
HidePopup(EPopupScreens.PopupPlayerControl);
}
if (_Fading)
@@ -345,30 +372,38 @@ namespace Vocaluxe.Menu
_GlobalAlpha = 1f;// -factor / 100f;
_ZOffset = CSettings.zFar/2;
Screens[(int)ActualScreen].Draw();
_Screens[(int)_CurrentScreen].Draw();
_GlobalAlpha = factor;
_ZOffset = 0f;
Screens[(int)NextScreen].Draw();
_Screens[(int)_NextScreen].Draw();
_GlobalAlpha = 1f;
}
else
{
Screens[(int)ActualScreen].OnClose();
ActualScreen = NextScreen;
NextScreen = EScreens.ScreenNull;
Screens[(int)ActualScreen].OnShowFinish();
Screens[(int)ActualScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
Screens[(int)ActualScreen].Draw();
_Screens[(int)_CurrentScreen].OnClose();
_CurrentScreen = _NextScreen;
_NextScreen = EScreens.ScreenNull;
if(CBackgroundMusic.Playing)
CBackgroundMusic.Play();
_Screens[(int)_CurrentScreen].OnShowFinish();
_Screens[(int)_CurrentScreen].ProcessMouseMove(_Cursor.X, _Cursor.Y);
_Screens[(int)_CurrentScreen].Draw();
_Fading = false;
_FadingTimer.Stop();
}
}
else
{
Screens[(int)ActualScreen].Draw();
_Screens[(int)_CurrentScreen].Draw();
}
for (int i = 0; i < _PopupScreens.Count; i++)
{
_PopupScreens[i].Draw();
}
_Cursor.Draw();
DrawDebugInfos();
@@ -377,7 +412,23 @@ namespace Vocaluxe.Menu
public static void FadeTo(EScreens Screen)
{
NextScreen = Screen;
_NextScreen = Screen;
}
public static void ShowPopup(EPopupScreens PopupScreen)
{
_PopupScreens[(int)PopupScreen].OnShow();
_PopupScreens[(int)PopupScreen].OnShowFinish();
_CurrentPopupScreen = PopupScreen;
}
public static void HidePopup(EPopupScreens PopupScreen)
{
if (_CurrentPopupScreen != PopupScreen)
return;
_PopupScreens[(int)PopupScreen].OnClose();
_CurrentPopupScreen = EPopupScreens.NoPopup;
}
public static void HideCursor()
@@ -398,6 +449,9 @@ namespace Vocaluxe.Menu
KeyEvent KeyEvent = new KeyEvent();
MouseEvent MouseEvent = new MouseEvent();
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenNames
&& _CurrentScreen != EScreens.ScreenSong;
bool Resume = true;
while (keys.PollEvent(ref KeyEvent))
{
@@ -406,6 +460,14 @@ namespace Vocaluxe.Menu
CSettings.MouseInacive();
_Cursor.FadeOut();
}
if (PopupPlayerControlAllowed && KeyEvent.Key == Keys.Tab)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
ShowPopup(EPopupScreens.PopupPlayerControl);
else
HidePopup(EPopupScreens.PopupPlayerControl);
}
if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.F1))
{
@@ -422,7 +484,14 @@ namespace Vocaluxe.Menu
else
{
if (!_Fading)
Resume &= Screens[(int)ActualScreen].HandleInput(KeyEvent);
{
bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = _PopupScreens[(int)_CurrentPopupScreen].HandleInput(KeyEvent);
if (!handled)
Resume &= _Screens[(int)_CurrentScreen].HandleInput(KeyEvent);
}
}
}
@@ -436,8 +505,22 @@ namespace Vocaluxe.Menu
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
if (!_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
Resume &= Screens[(int)ActualScreen].HandleMouse(MouseEvent);
bool isOverPopupPlayerControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupPlayerControl].ScreenArea, MouseEvent);
if (PopupPlayerControlAllowed && isOverPopupPlayerControl)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
ShowPopup(EPopupScreens.PopupPlayerControl);
}
if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl)
HidePopup(EPopupScreens.PopupPlayerControl);
bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent);
}
return Resume;
}
@@ -452,7 +535,7 @@ namespace Vocaluxe.Menu
if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.F1))
{
CSettings.GameState = EGameState.Normal;
Screens[(int)ActualScreen].NextInteraction();
_Screens[(int)_CurrentScreen].NextInteraction();
}
else if (KeyEvent.ModALT && (KeyEvent.Key == Keys.Enter))
{
@@ -465,14 +548,14 @@ namespace Vocaluxe.Menu
else
{
if (!_Fading)
Screens[(int)ActualScreen].HandleInputThemeEditor(KeyEvent);
_Screens[(int)_CurrentScreen].HandleInputThemeEditor(KeyEvent);
}
}
while (Mouse.PollEvent(ref MouseEvent))
{
if (!_Fading)
Screens[(int)ActualScreen].HandleMouseThemeEditor(MouseEvent);
_Screens[(int)_CurrentScreen].HandleMouseThemeEditor(MouseEvent);
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
}
@@ -486,7 +569,9 @@ namespace Vocaluxe.Menu
private static bool Update()
{
return Screens[(int)ActualScreen].UpdateGame();
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
_PopupScreens[(int)_CurrentPopupScreen].UpdateGame();
return _Screens[(int)_CurrentScreen].UpdateGame();
}
private static void DrawDebugInfos()
+7 -9
View File
@@ -11,14 +11,6 @@ using Vocaluxe.Lib.Song;
namespace Vocaluxe.Menu
{
enum ELyricStyle
{
Fill,
Jump,
Slide,
Zoom
}
struct SNote
{
public string Text;
@@ -84,6 +76,12 @@ namespace Vocaluxe.Menu
}
}
public ELyricStyle LyricStyle
{
get { return _Style; }
set { _Style = value; }
}
public CLyric()
{
_Theme = new SThemeLyrics();
@@ -100,7 +98,7 @@ namespace Vocaluxe.Menu
_Notes = new List<SNote>();
_Text = new CText();
_Style = ELyricStyle.Slide;
_Style = ELyricStyle.Fill;
}
public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex)
+9 -2
View File
@@ -62,6 +62,13 @@ namespace Vocaluxe.Menu
protected string[] _ThemeSingNotes;
protected string[] _ThemeNameSelections;
protected SRectF _ScreenArea;
public SRectF ScreenArea
{
get { return _ScreenArea; }
}
public int ThemeScreenVersion
{
get { return _ScreenVersion; }
@@ -104,6 +111,7 @@ namespace Vocaluxe.Menu
_MouseDY = 0;
_Active = false;
_ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f);
_ThemeName = String.Empty;
_ThemeBackgrounds = null;
@@ -928,13 +936,12 @@ namespace Vocaluxe.Menu
{
ResumeBG();
_Active = true;
CBackgroundMusic.Play();
}
public virtual void OnClose()
{
PauseBG();
CBackgroundMusic.Pause();
_Active = false;
}
#endregion MenuHandler
@@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
using Vocaluxe.Lib.Song;
namespace Vocaluxe.Screens
{
class CPopupScreenPlayerControl : CMenu
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 1;
private const string StaticBG = "StaticBG";
private const string StaticCover = "StaticCover";
private const string ButtonPrevious = "ButtonPrevious";
private const string ButtonPlay = "ButtonPlay";
private const string ButtonPause = "ButtonPause";
private const string ButtonNext = "ButtonNext";
private const string ButtonRepeat = "ButtonRepeat";
private const string ButtonShowVideo = "ButtonShowVideo";
private const string ButtonSing = "ButtonSing";
private const string ButtonToBackgroundVideo = "ButtonToBackgroundVideo";
private const string TextCurrentSong = "TextCurrentSong";
private bool _VideoPreview = false;
private bool VideoPreview
{
get
{
return _VideoPreview;
}
set
{
_VideoPreview = value;
if (!_VideoPreview && !VideoBackground)
CBackgroundMusic.VideoEnabled = false;
else
CBackgroundMusic.VideoEnabled = true;
}
}
private bool VideoBackground
{
get
{
return CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON;
}
set
{
if (!value)
{
if (CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON)
{
CConfig.VideosToBackground = EOffOn.TR_CONFIG_OFF;
if (!_VideoPreview)
CBackgroundMusic.VideoEnabled = false;
}
}
else
{
CConfig.VideosToBackground = EOffOn.TR_CONFIG_ON;
CBackgroundMusic.VideoEnabled = true;
}
CConfig.SaveConfig();
}
}
public CPopupScreenPlayerControl()
{
Init();
}
protected override void Init()
{
base.Init();
_ThemeName = "PopupScreenPlayerControl";
_ScreenVersion = ScreenVersion;
_ThemeStatics = new string[] { StaticBG, StaticCover };
_ThemeTexts = new string[] { TextCurrentSong };
List<string> buttons = new List<string>();
buttons.Add(ButtonPlay);
buttons.Add(ButtonPause);
buttons.Add(ButtonPrevious);
buttons.Add(ButtonNext);
buttons.Add(ButtonRepeat);
buttons.Add(ButtonShowVideo);
buttons.Add(ButtonSing);
buttons.Add(ButtonToBackgroundVideo);
_ThemeButtons = buttons.ToArray();
}
public override void LoadTheme()
{
base.LoadTheme();
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
}
public override bool HandleInput(KeyEvent KeyEvent)
{
base.HandleInput(KeyEvent);
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
{
}
else
{
switch (KeyEvent.Key)
{
case Keys.Escape:
case Keys.Back:
CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
return false;
case Keys.Enter:
if (Buttons[htButtons(ButtonNext)].Selected)
CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected)
CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected)
CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected)
CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat();
if (Buttons[htButtons(ButtonShowVideo)].Selected)
VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
VideoBackground = !VideoBackground;
break;
}
}
return true;
}
public override bool HandleMouse(MouseEvent MouseEvent)
{
base.HandleMouse(MouseEvent);
if (MouseEvent.LB && IsMouseOver(MouseEvent))
{
if (Buttons[htButtons(ButtonNext)].Selected)
CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected)
CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected)
CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected)
CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat();
if (Buttons[htButtons(ButtonShowVideo)].Selected)
VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected)
VideoBackground = !VideoBackground;
} else if (MouseEvent.LB)
{
//CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
return false;
} else if (MouseEvent.RB)
{
//CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
return false;
}
return true;
}
public override bool UpdateGame()
{
Statics[htStatics(StaticCover)].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo;
Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground;
Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview;
Buttons[htButtons(ButtonSing)].Visible = CBackgroundMusic.CanSing;
return true;
}
public override void OnShow()
{
base.OnShow();
}
public override bool Draw()
{
if (!_Active)
return false;
Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.Cover;
if (CBackgroundMusic.VideoEnabled && VideoPreview && CBackgroundMusic.SongHasVideo)
CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop);
Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.Playing;
Buttons[htButtons(ButtonPlay)].Visible = !CBackgroundMusic.Playing;
Texts[htTexts(TextCurrentSong)].Text = CBackgroundMusic.ArtistAndTitle;
return base.Draw();
}
private void StartSong(int SongNr, bool Duet)
{
if (SongNr >= 0 && CSongs.SongsLoaded)
{
if (Duet)
CGame.SetGameMode(GameModes.EGameMode.Duet);
else
CGame.SetGameMode(GameModes.EGameMode.Normal);
CGame.Reset();
CGame.ClearSongs();
CGame.AddSong(SongNr);
CGraphics.FadeTo(EScreens.ScreenNames);
}
}
}
}
+9 -3
View File
@@ -120,6 +120,9 @@ namespace Vocaluxe.Screens
_Intros[i].Load(IntroVideo[i]);
}
}
if (!CBackgroundMusic.Playing)
CBackgroundMusic.Next();
}
public override void OnShowFinish()
@@ -139,7 +142,7 @@ namespace Vocaluxe.Screens
_SongLoaderThread.Start();
_timer.Start();
if (!CBackgroundMusic.IsPlaying())
if (!CBackgroundMusic.Playing)
CBackgroundMusic.Next();
}
@@ -173,9 +176,10 @@ namespace Vocaluxe.Screens
{
CBackgroundMusic.AddOwnMusic();
if (!CBackgroundMusic.IsPlaying())
CBackgroundMusic.Next();
//if (!CBackgroundMusic.Playing)
// CBackgroundMusic.Next();
}
CBackgroundMusic.CanSing = false;
return true;
}
@@ -204,6 +208,8 @@ namespace Vocaluxe.Screens
_Intros[i].Close();
}
CBackgroundMusic.CanSing = true;
CLog.StopBenchmark(3, "Load Cover");
}
+4 -4
View File
@@ -65,14 +65,14 @@ namespace Vocaluxe.Screens
CGraphics.FadeTo(EScreens.ScreenSong);
break;
case Keys.T:
CGraphics.FadeTo(EScreens.ScreenTest);
break;
case Keys.C:
CGraphics.FadeTo(EScreens.ScreenCredits);
break;
case Keys.T:
CGraphics.FadeTo(EScreens.ScreenTest);
break;
case Keys.Enter:
if (Buttons[htButtons(ButtonSing)].Selected)
CGraphics.FadeTo(EScreens.ScreenSong);
+107 -1
View File
@@ -51,6 +51,8 @@ namespace Vocaluxe.Screens
private bool _DelayTestRunning;
private int _DelaySound;
private Equalizer[] _Equalizer;
public CScreenOptionsRecord()
{
Init();
@@ -254,7 +256,8 @@ namespace Vocaluxe.Screens
_DelayTest[i].Timer.Stop();
_DelayTestRunning = false;
}
else if (CSound.RecordGetMaxVolume(player - 1) > 0.4f && CSound.RecordGetToneAbs(player - 1) == 9)
else if (CSound.RecordGetMaxVolume(player - 1) > 0.1f &&
(CSound.RecordGetToneAbs(player - 1) == 9 || CSound.RecordGetToneAbs(player - 1) == 21 || CSound.RecordGetToneAbs(player - 1) == 33))
{
_DelayTest[i].Delay = _DelayTest[i].Timer.ElapsedMilliseconds;
_DelayTest[i].Timer.Stop();
@@ -274,20 +277,27 @@ namespace Vocaluxe.Screens
if (player > 0)
{
ChannelEnergy[0] = CSound.RecordGetMaxVolume(player - 1);
_Equalizer[0].Update(CSound.ToneWeigth(player - 1));
}
else
_Equalizer[0].Reset();
ChannelEnergy[1] = 0f;
player = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection;
if (player > 0)
{
ChannelEnergy[1] = CSound.RecordGetMaxVolume(player - 1);
_Equalizer[1].Update(CSound.ToneWeigth(player - 1));
}
else
_Equalizer[1].Reset();
}
else
{
for (int i = 0; i < ChannelEnergy.Length; i++)
{
ChannelEnergy[i] = 0f;
_Equalizer[i].Reset();
}
}
@@ -351,6 +361,13 @@ namespace Vocaluxe.Screens
_DelayTestRunning = false;
_DelaySound = -1;
_Equalizer = new Equalizer[2];
for (int i = 0; i < _Equalizer.Length; i++)
{
_Equalizer[i] = new Equalizer(new SRectF(50 + 350 * i, 400, 230, 150, -1), CSound.NumHalfTones(0), 2);
}
}
public override void OnShowFinish()
@@ -389,6 +406,11 @@ namespace Vocaluxe.Screens
}
}
for (int i = 0; i < _Equalizer.Length; i++)
{
_Equalizer[i].Draw();
}
DrawFG();
return true;
@@ -571,4 +593,88 @@ namespace Vocaluxe.Screens
}
}
}
class Equalizer
{
private SRectF _Bounds;
private float _Space;
private float[] _Bars;
public Equalizer(SRectF bounds, int numBars, float space)
{
_Bounds = bounds;
_Space = space;
if (numBars > 0)
_Bars = new float[numBars];
}
public void Update(float[] weights)
{
if (weights == null || weights.Length == 0 || _Bars == null)
return;
if (_Bars.Length < weights.Length)
{
}
else if (_Bars.Length > weights.Length)
{
}
else
{
for (int i = 0; i < _Bars.Length; i++)
{
//if (weights[i] > 0)
_Bars[i] = weights[i];
//else
// _Bars[i] = 0f;
}
}
}
public void Reset()
{
if (_Bars == null || _Bars.Length == 0)
return;
for (int i = 0; i < _Bars.Length; i++)
{
_Bars[i] = 0f;
}
}
public void Draw()
{
if (_Bars == null)
return;
float dx = _Bounds.W / _Bars.Length + _Space;
int max = _Bars.Length - 1;
float maxB = _Bars[max];
for (int i = 0; i < _Bars.Length - 1; i++)
{
if (_Bars[i] > maxB)
{
maxB = _Bars[i];
max = i;
}
}
for (int i = 0; i < _Bars.Length; i++)
{
SRectF bar = new SRectF(_Bounds.X + dx * i, _Bounds.Y + _Bounds.H - _Bars[i] * _Bounds.H, dx - _Space, _Bars[i] * _Bounds.H, _Bounds.Z);
SColorF color = new SColorF(1f, 1f, 1f, 1f);
if (i == max)
{
color.B = 0f;
color.G = 0f;
}
CDraw.DrawColor(color, bar);
}
}
}
}
+7 -2
View File
@@ -12,11 +12,12 @@ namespace Vocaluxe.Screens
class CScreenOptionsVideo : CMenu
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 1;
const int ScreenVersion = 2;
private const string SelectSlideVideoBackgrounds = "SelectSlideVideoBackgrounds";
private const string SelectSlideVideoPreview = "SelectSlideVideoPreview";
private const string SelectSlideVideosInSongs = "SelectSlideVideosInSongs";
private const string SelectSlideVideosToBackground = "SelectSlideVideosToBackground";
private const string ButtonExit = "ButtonExit";
@@ -33,7 +34,7 @@ namespace Vocaluxe.Screens
_ScreenVersion = ScreenVersion;
_ThemeButtons = new string[] { ButtonExit };
_ThemeSelectSlides = new string[] { SelectSlideVideoBackgrounds, SelectSlideVideoPreview, SelectSlideVideosInSongs };
_ThemeSelectSlides = new string[] { SelectSlideVideoBackgrounds, SelectSlideVideoPreview, SelectSlideVideosInSongs, SelectSlideVideosToBackground };
}
public override void LoadTheme()
@@ -43,6 +44,7 @@ namespace Vocaluxe.Screens
SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].SetValues<EOffOn>((int)CConfig.VideoBackgrounds);
SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues<EOffOn>((int)CConfig.VideoPreview);
SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].SetValues<EOffOn>((int)CConfig.VideosInSongs);
SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].SetValues<EOffOn>((int)CConfig.VideosToBackground);
}
public override bool HandleInput(KeyEvent KeyEvent)
@@ -110,6 +112,7 @@ namespace Vocaluxe.Screens
public override bool UpdateGame()
{
SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection = (int)CConfig.VideosToBackground;
return true;
}
@@ -124,6 +127,8 @@ namespace Vocaluxe.Screens
CConfig.VideoBackgrounds = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].Selection;
CConfig.VideoPreview = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoPreview)].Selection;
CConfig.VideosInSongs = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].Selection;
CConfig.VideosToBackground = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection;
CBackgroundMusic.VideoEnabled = true;
CConfig.SaveConfig();
}
+10 -2
View File
@@ -359,10 +359,17 @@ namespace Vocaluxe.Screens
NoteLines[i] = -1;
}
for (int i = 0; i < Lyrics.Length; i++)
{
Lyrics[i].LyricStyle = CConfig.LyricStyle;
}
SetVisuability();
UpdateAvatars();
UpdateNames();
CBackgroundMusic.Pause();
CBackgroundMusic.Disabled = true;
}
public override void OnShowFinish()
@@ -371,7 +378,7 @@ namespace Vocaluxe.Screens
CGame.Start();
LoadNextSong();
CBackgroundMusic.Pause();
CBackgroundMusic.Disabled = true;
}
public override bool Draw()
@@ -454,6 +461,7 @@ namespace Vocaluxe.Screens
public override void OnClose()
{
base.OnClose();
CBackgroundMusic.Disabled = false;
CloseSong();
}
+4 -3
View File
@@ -187,12 +187,12 @@ namespace Vocaluxe.Screens
if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length)
{
Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
CBackgroundMusic.Pause();
CBackgroundMusic.Disabled = true;
}
else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length)
{
Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name;
CBackgroundMusic.Play();
CBackgroundMusic.Disabled = false;
}
else
Texts[htTexts(TextSelection)].Text = String.Empty;
@@ -227,6 +227,7 @@ namespace Vocaluxe.Screens
public override void OnClose()
{
base.OnClose();
CBackgroundMusic.Disabled = false;
SongMenus[htSongMenus(SongMenu)].OnHide();
}
@@ -351,4 +352,4 @@ namespace Vocaluxe.Screens
SongMenus[htSongMenus(SongMenu)].OnShow();
}
}
}
}
+3 -3
View File
@@ -50,15 +50,15 @@ namespace Vocaluxe.Screens
break;
case Keys.F:
FadeAndPause();
//FadeAndPause();
break;
case Keys.S:
PlayFile();
//PlayFile();
break;
case Keys.P:
PauseFile();
//PauseFile();
break;
}
}
+2
View File
@@ -148,6 +148,7 @@
</Compile>
<Compile Include="Lib\Song\CNotes.cs" />
<Compile Include="Lib\Song\CSong.cs" />
<Compile Include="Lib\Sound\CDirectSoundRecord.cs" />
<Compile Include="Lib\Sound\COpenALPlay.cs" />
<Compile Include="Lib\Sound\COpenALRecord.cs" />
<Compile Include="Base\CSound.cs" />
@@ -188,6 +189,7 @@
<Compile Include="Program.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Screens\CPopupScreenPlayerControl.cs" />
<Compile Include="Screens\CScreenCredits.cs" />
<Compile Include="Screens\CScreenHighscore.cs" />
<Compile Include="Screens\CScreenLoad.cs" />