logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Owensoundstudios  
#1 Posted : Wednesday, July 8, 2015 9:32:44 PM(UTC)
Owensoundstudios

Rank: Member

Groups: Registered
Joined: 5/12/2015(UTC)
Posts: 11
Location: Edmonton

I'd like to generate a csv file or something to put a list for a leaderboard on screen over a custom graphic. I generate a csv, but it only picks up the first name in the list.
"Bob", 80
"Carry" 70

Anyone have ideas on how to make a leaderboard that grabs data from a txt file or anything?
Owensoundstudios  
#2 Posted : Thursday, July 9, 2015 5:30:01 PM(UTC)
Owensoundstudios

Rank: Member

Groups: Registered
Joined: 5/12/2015(UTC)
Posts: 11
Location: Edmonton

Maybe if vmix is grabbing a whole list of different titles they could remain seperated by a CR and if it's supposed to be a list they could be seperated by a comma?
Kelvin  
#3 Posted : Friday, July 10, 2015 9:36:12 PM(UTC)
Kelvin

Rank: Advanced Member

Groups: Registered
Joined: 2/9/2013(UTC)
Posts: 261
Location: Katy, Texas

Was thanked: 37 time(s) in 37 post(s)
I've used a custom built excel spreadsheet to create a leader board. Excel runs on the vMix computer on a third monitor. The background for the excel spreadsheet is green so it can be chroma-keyed out. This comes into vMix using the screen capture input. Its not the most elegant solution, but it works for my needs. If you want to get fancy with your formatting in excel, it can look quite professional.
Speegs  
#4 Posted : Saturday, July 11, 2015 1:51:09 AM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 405
Location: Gold Coast, Australia

Thanks: 27 times
Was thanked: 76 time(s) in 58 post(s)
Kelvin wrote:
I've used a custom built excel spreadsheet to create a leader board. Excel runs on the vMix computer on a third monitor. The background for the excel spreadsheet is green so it can be chroma-keyed out. This comes into vMix using the screen capture input. Its not the most elegant solution, but it works for my needs. If you want to get fancy with your formatting in excel, it can look quite professional.


Another option is to write a script in your favourite language, Powershell, VBScript, AutoHotKey (I like powershell). Then make that script inject the data (text) you want to your Vmix title via the web API. Then you just design XAML title for Vmix and use a script + with webapi to populate data. It's like having a second person instantly entering information for you and kind of creepy to watch.

I've found this successful for me of course you need to action something to cause the update of the information from the CSV. It's a bit advanced, should be easier to accomplish however in future versions of Vmix that will include scripting.

Still not perfectly elegant and quite possibly more work than a simple chroma key from excel.

I recently used this "trick" to display the filename (without the extension) of the currently playing video clip in a playlist a title and a few other projects as well with variations on this web api + script controlling it method.
doggy  
#5 Posted : Saturday, July 11, 2015 4:35:03 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,218
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
I send my data from the scoring program (sorted list) to a xml file

The xaml usercontrol at regular interval checks the xml for updates and updates the displays of the list (a binded listview or stackpanel) in the title -> instant update of ranking table

just wish I could integrate some animation during the update ;-)
richardgatarski  
#6 Posted : Saturday, July 11, 2015 10:34:25 AM(UTC)
richardgatarski

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2014(UTC)
Posts: 1,837
Location: Stockholm

Thanks: 144 times
Was thanked: 297 time(s) in 250 post(s)
@Owensoundstudios
Not sure what you are after. But if it's OK with manual loading of the text file you generate, that is pretty straightforward by importing it as a .csv by right-clicking in the Title Inputs preview.

The example you give for content is badly formatted, which might be the cause of you only getting one line. Correct is:
"Bob","80"
"Carry","70"
Speegs  
#7 Posted : Sunday, July 12, 2015 8:08:03 AM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 405
Location: Gold Coast, Australia

Thanks: 27 times
Was thanked: 76 time(s) in 58 post(s)
doggy wrote:
I send my data from the scoring program (sorted list) to a xml file

The xaml usercontrol at regular interval checks the xml for updates and updates the displays of the list (a binded listview or stackpanel) in the title -> instant update of ranking table

just wish I could integrate some animation during the update ;-)


Any chance of posting a sample of that, not you whole project just those actions?

I could learn more about xaml :) it is on my todo list...
doggy  
#8 Posted : Sunday, July 12, 2015 1:18:10 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,218
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Compiled as a .dll
Sure it can be improved
Just update/add to xml file (externally)and will instantly update the title

Usercontrol.xaml
Code:
<UserControl x:Class="UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Width="1920" Height="1080" xmlns:my="clr-namespace:vMixTitleLibrary;assembly=vMixTitleLibrary">

    <UserControl.Resources>


        <XmlDataProvider x:Key="xmlDP" XPath="DocumentElement" />

        <DataTemplate x:Key="BlueHeader">
            <StackPanel Orientation="Horizontal" Margin="-5,-5,-5,-5" Width="550">
                <StackPanel.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF223B84" Offset="1"/>
                        <GradientStop Color="#FF57A0F4" Offset="0.5"/>
                        <GradientStop Color="#FF4B94EC" Offset="0.5"/>
                    </LinearGradientBrush>
                </StackPanel.Background>
                <TextBlock Margin="10,10,10,10" Text="{Binding}" 
    					VerticalAlignment="Center"  Foreground="Red" />
            </StackPanel>
        </DataTemplate>

        <Style x:Key="alternatingStyle" TargetType="{x:Type ListViewItem}">
            <Style.Triggers>
                <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                    <Setter Property="Background" Value="LightSkyBlue"/>
                </Trigger>
                <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                    <Setter Property="Background" Value="LightGray"/>
                </Trigger>
            </Style.Triggers>
        </Style>

    </UserControl.Resources>


    
    <!--XPath=runlist[position()\&lt;\4]
        only shows first 3 of the list-->
    
    <Grid  >

        <ListView ItemContainerStyle="{StaticResource alternatingStyle}" AlternationCount="2" ItemsSource="{Binding Source={StaticResource xmlDP}, XPath=runlist}" FontSize="18" FontWeight="Bold" Foreground="Black" Background="{x:Null}"  Name="ListView1" BorderBrush="{x:Null}" Margin="100,238,1320,142" FontFamily="Arial" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
             <ListView.View>
                <GridView ColumnHeaderTemplate="{StaticResource BlueHeader}" >

                    <GridViewColumn Header="Nr" DisplayMemberBinding="{Binding XPath=NR}" Width="50" />
                    <GridViewColumn Header="Dog" DisplayMemberBinding="{Binding XPath=Dog}" Width="150" />
                    <GridViewColumn Header="Handler" DisplayMemberBinding="{Binding XPath=Handler}" Width="300" />
                
                </GridView>
            </ListView.View>
        </ListView>



        <ListBox  ItemsSource="{Binding Source={StaticResource xmlDP}, XPath=runlist}" Width="899" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="{x:Null}" Margin="901,238,120,142" BorderThickness="0">
            <ListBox.ItemTemplate>
                <DataTemplate>
                        <StackPanel Orientation="Horizontal" Height="30" Width="500" Margin="2"  >
                        <StackPanel.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                <GradientStop Color="#FFC5D7F6" Offset="0.683"/>
                            </LinearGradientBrush>
                        </StackPanel.Background>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <TextBlock Text="{Binding XPath=NR}" FontSize="20" Width="50" FontWeight="Bold" Height="50" ></TextBlock>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <TextBlock Text="{Binding XPath=Dog}" FontSize="20" Width="150" FontWeight="Bold" Height="50" ></TextBlock>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Margin="2">
                            <TextBlock Text="{Binding XPath=Handler}" FontSize="20" Width="300"  FontWeight="Bold" Height="50"></TextBlock>
                        </StackPanel>
                    </StackPanel>
                 </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>


    </Grid>

</UserControl>



Usercontrol.xaml
Code:
Imports System.Windows.Threading
Imports System.Windows.Media.Imaging
Imports System.IO
Imports System.Xml

Public Class UserControl1
    Private WithEvents m_Timer As New DispatcherTimer
    Private m_LastUpdated As Date
    Private Sub UserControl1_LayoutUpdated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LayoutUpdated
        If m_Timer IsNot Nothing Then
            m_Timer.Interval = TimeSpan.FromMilliseconds(500)
            m_Timer.Start()
        End If
    End Sub
    Private Sub m_Timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles m_Timer.Tick

        InitializeComponent()

         Dim doc As New XmlDocument()
        doc.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location) & "\Rankingfile.xml")
        Dim dp As XmlDataProvider = DirectCast(Me.FindResource("xmlDP"), XmlDataProvider)
        '... and assign the XDoc to it, imports the XDoc's root.
        dp.Document = doc
        dp.XPath = "DocumentElement"


    End Sub

End Class


Rankingfile.xml
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DocumentElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<runlist>
		<NR>1</NR>
		<Handler>Name 1</Handler>
		<Dog>Dog 1</Dog>
	</runlist>
	<runlist>
		<NR>2</NR>
		<Handler>Name 2</Handler>
		<Dog>dog 2</Dog>
	</runlist>
</DocumentElement>




doggy attached the following image(s):
ranking.png (23kb) downloaded 25 time(s).

You cannot view/download attachments. Try to login or register.
thanks 1 user thanked doggy for this useful post.
Speegs on 7/12/2015(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.