| 
	Rank: Advanced Member
 Groups: Registered
Joined: 4/3/2014(UTC)
 Posts: 58
 Location: UK
 
 Thanks: 19 timesWas thanked: 4 time(s) in 1 post(s)
 
 | 
            
		      
                I have written a blend dll and i would like to call a couple of vMix function when things happen.
 Essentially i want to open TCP port 8099 and make a function call in blend i guess...
 
 Could smebody share the code i migtht need with the includes
 
 Thanks
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 8/21/2015(UTC) Posts: 324   Location: Cornwall, Ontario, CanadaThanks: 18 timesWas thanked: 80 time(s) in 60 post(s)
 
 | 
            
		      
                Need to add web browser in code and make it not visible then send api command.Visual Basic code example:Add Web browser <WebView x:Name="WebBrowser" HorizontalAlignment="Stretch"  Height="100" Margin="286,868,0,0" VerticalAlignment="Stretch" Width="100" Visibility="Collapsed" d:IsHidden="True" />Send API command via HTTP (vMix API command is in RED)Uri  is the HTTP command you want to send. WebBrowser.Navigate(New Uri("http://127.0.0.1:8099/API/?Function=SetText&SelectedIndex=1&Value=Camera%20Preset&Input=1 ")) smudge1977 wrote:I have written a blend dll and i would like to call a couple of vMix function when things happen.
 Essentially i want to open TCP port 8099 and make a function call in blend i guess...
 
 Could smebody share the code i migtht need with the includes
 
 Thanks
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,445  Location: BelgiumThanks: 311 timesWas thanked: 1005 time(s) in 829 post(s)
 
 | 
            
		      
                or directly send httprequest from within your code, no need to open a webbrowser | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
Joined: 4/3/2014(UTC)
 Posts: 58
 Location: UK
 
 Thanks: 19 timesWas thanked: 4 time(s) in 1 post(s)
 
 | 
            
		      
                Here is what is used (not using http as plain text on port 8099 will be faster) As i say this is running in the compiled DLL from the xaml for a title input. This makes the code a nightmare to debug! Would even be nice to know where Console.WriteLine outputs stuff....??? This as you can tell was a kind of quick copy paste from a stackexchange page! Need to do the read before the write to get the data that is 'waiting' after you connect to vMix! Function vMixCall(command As String)         Dim client = New TcpClient()         Try             client.Connect("127.0.0.1", 8099)             Dim networkStream As NetworkStream = client.GetStream()             ' Read the NetworkStream into a byte buffer.             'This reads the welcome header fro vMix             Dim bytes(client.ReceiveBufferSize) As Byte             networkStream.Read(bytes, 0, CInt(client.ReceiveBufferSize))             ' Output the data received from the host to the console.             Dim returndata As String = Encoding.ASCII.GetString(bytes)             Console.WriteLine(("Host returned: " + returndata))             Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(command + vbCrLf)             networkStream.Write(sendBytes, 0, sendBytes.Length)         Catch ex As Exception         Finally             client.Close()         End Try         'FUNCTION OverlayInput1 Input=2         'PowerRed.Text = "2"     End Function File Attachment(s):   UserControl1.xaml (6kb) downloaded 79 time(s).  UserControl1.xaml - Copy.vb.txt (6kb) downloaded 76 time(s).You cannot view/download attachments. Try to login or register. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 2/2/2018(UTC)
 Posts: 13
 Location: Foz do Iguaçu
 
 Thanks: 5 times
 |  | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
	
    
        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.
	
	
    
    
        Important Information:
        The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
        
        
More Details
        Close