Solo, bypass (and fader) on Machines?
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Solo, bypass (and fader) on Machines?
I wonder, since the machines have a on/offbutton in the left top corner and a closebutton in the top right, would it be possible to add more buttons. I think it would be nice to also have a solo and a Bypassbutton.
I also remember being able to pan in old Buzz. Would it be possible to use this function as a fader? It would be very nice with the KrossIn Krossout.
Joachip, I hope you're ok with me using your nice avatar.
I also remember being able to pan in old Buzz. Would it be possible to use this function as a fader? It would be very nice with the KrossIn Krossout.
Joachip, I hope you're ok with me using your nice avatar.
- Attachments
-
- buzz forums • Viewing profile Joachip.png (11.5 KiB) Viewed 6904 times
Re: Solo, bypass (and fader) on Machines?
I think it should be possible to do anything you like if you have the XAML skills. Sadly I don't have the skills.
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Ah. That xaml... Unfortunately I don't have that skills either.IXix wrote:I think it should be possible to do anything you like if you have the XAML skills. Sadly I don't have the skills.
Re: Solo, bypass (and fader) on Machines?
It's a valid idea though.AndersBrontosaurus wrote:Ah. That xaml... Unfortunately I don't have that skills either.
New buttons should be fairly easy to work out. Panning might be a little bit more difficult but I don't really know. It's basically just a matter of defining an element and binding it to the appropriate command. This is the led/mute button definition from MachineControl.xaml...
Code: Select all
<Button Name="ledButton" Command="{Binding MuteCommand}" Canvas.Left="2" Canvas.Top="2" Style="{StaticResource SmallButtonStyle}" BorderBrush="Black" BorderThickness="1" ToolTip="Mute">
<Button.Background>
<SolidColorBrush Color="{Binding Path=MachineLEDOffColor}"/>
</Button.Background>
<Image Name="ledButtonSkinImage" Visibility="Collapsed"/>
</Button>
edit: okay, I admit I probably do have the skills.
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Yes. Being a zero on coding this is what I was thinking or hoping, that they were bound together in some way. I assume "solo" would be easier then since there is a solofunction already while bypassing demands more coding since there isno command to bind it to yet?
Ummm...yes, it certainly looks so.IXix wrote:edit: okay, I admit I probably do have the skills.
Re: Solo, bypass (and fader) on Machines?
No, there will be a bypass command to bind to. Same with the panning, you just have to bind a control to the correct machine parameter but I don't know how to access that without some digging. Here are most of the commands (the ones that should work as buttons) defined by the MachineControl, if you feel like getting your toes wet...AndersBrontosaurus wrote:I assume "solo" would be easier then since there is a solofunction already while bypassing demands more coding since there isno command to bind it to yet?
Code: Select all
DeleteCommand
MuteCommand
SoloCommand
BypassCommand
OversampleCommand
WirelessCommand
LatencyCommand
CloneCommand
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Ooh! I'll definitely try. Seems like I can't really mess something up and it would be awesome to contribute with actual coding. (even if it'll most be copy-edit-paste). Right now it seems like the biggest task will be where to get and put the code.
Re: Solo, bypass (and fader) on Machines?
That's the spirit! Make a backup before you start tinkering.AndersBrontosaurus wrote:Ooh! I'll definitely try. Seems like I can't really mess something up and it would be awesome to contribute with actual coding. (even if it'll most be copy-edit-paste). Right now it seems like the biggest task will be where to get and put the code.
Program Files\Jeskola Buzz\Themes\<your_theme>\MachineView\MachineControl.xaml
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Ok. It wasn't as simple as I had hoped. I thought I'd get away with just renaming and rebinding to other commands but I got several windows full of complaints about object references. Any obvious mistakes?
[spoiler]
[/spoiler]
[spoiler]
Code: Select all
<!-- led/mute button -->
<Canvas>
<Button Name="ledButton" Command="{Binding MuteCommand}" Canvas.Left="2" Canvas.Top="2" Style="{StaticResource SmallButtonStyle}" BorderBrush="Black" BorderThickness="1" ToolTip="Mute">
<Button.Background>
<SolidColorBrush Color="{Binding Path=MachineLEDOffColor}"/>
</Button.Background>
<Image Name="ledButtonSkinImage" Visibility="Collapsed"/>
</Button>
</Canvas>
<!-- Solo button -->
<Canvas>
<Button Name="SoloButton" Command="{Binding SoloCommand}" Canvas.Left="10" Canvas.Top="2" Style="{StaticResource SmallButtonStyle}" BorderBrush="Black" BorderThickness="1" ToolTip="Solo">
<Button.Background>
<SolidColorBrush Color="{Binding Path=MachineLEDOffColor}"/>
</Button.Background>
<Image Name="ledButtonSkinImage" Visibility="Collapsed"/>
</Button>
</Canvas>
<!-- Bypass button -->
<Canvas>
<Button Name="BypassButton" Command="{Binding BypassCommand}" Canvas.Left="20" Canvas.Top="2" Style="{StaticResource SmallButtonStyle}" BorderBrush="Black" BorderThickness="1" ToolTip="Bypass">
<Button.Background>
<SolidColorBrush Color="{Binding Path=MachineLEDOffColor}"/>
</Button.Background>
<Image Name="ledButtonSkinImage" Visibility="Collapsed"/>
</Button>
</Canvas>
Re: Solo, bypass (and fader) on Machines?
Try putting all the buttons inside a single canvas element. Just a guess.AndersBrontosaurus wrote:Ok. It wasn't as simple as I had hoped. I thought I'd get away with just renaming and rebinding to other commands but I got several windows full of complaints about object references. Any obvious mistakes?
Re: Solo, bypass (and fader) on Machines?
Just had a quick look and I think the led button is in a canvas because it has to update rapidly in response to th machine audio. The delete button is on its own outside the canvas so I tried duplicating the delete button and making it function as solo. It worked but then there are alignment issues so I wrapped both buttons in a horizontal StackPanel and that looks like the best way to go. Here's the code...
Obviously that's a pretty crappy implementation but it works. You'd just need to sort out a button style and some images to make it look nice. The button styles are defined at the top of the file. You should probably copy the DeleteButtonStyle and tweak it for the behaviour you want.
Now I'd better go and do something that I'm supposed to be doing...
Code: Select all
<StackPanel Orientation="Horizontal" Margin="0,3,3,0" HorizontalAlignment="Right" VerticalAlignment="Top">
<Button Name="deleteButton" Command="{Binding DeleteCommand}" Style="{StaticResource DeleteButtonStyle}" BorderThickness="0" BorderBrush="#000000" Background="Transparent" ToolTip="Delete"/>
<Button Name="soloButton" Command="{Binding SoloCommand}" Style="{StaticResource DeleteButtonStyle}" BorderBrush="Black" BorderThickness="0" ToolTip="Solo" />
</StackPanel>
Code: Select all
<Style x:Key="DeleteButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource SmallButtonStyle}">
<Setter Property="Width" Value="9"/>
<Setter Property="Height" Value="9"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Path Name="path" Data="M0,0 L1,1 M0,1 L1,0" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Stretch="Fill"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="path" Property="Stroke" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Re: Solo, bypass (and fader) on Machines?
Oh btw, in case you weren't aware, you can edit the files and just reload your theme from the Themes menu to see the changes. No need to restart Buzz.
Re: Solo, bypass (and fader) on Machines?
I was wrong about that. I forgot that panning is a property of the machine connections, not the machines, so a pan control on the machine wouldn't make sense.IXix wrote:Same with the panning, you just have to bind a control to the correct machine parameter but I don't know how to access that without some digging.
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Eeehh...hhrrmm... A canvas is what you use for painting so I think I made the assumption that canvas was the name used for this particular machinebox. . I know better now. A canvas Defines an area within which you can explicitly position child elements by using coordinates that are relative to the Canvas area.
I'll have a little try and see what comes out.
I'll have a little try and see what comes out.
Good thinking. No, I was definitely not aware.IXix wrote:Oh btw, in case you weren't aware, you can edit the files and just reload your theme from the Themes menu to see the changes. No need to restart Buzz.
Ok. Then, a follow-up question? Since my initial idea was to use a slider as a fader or rather a crossfader on KrossIn/Out, would it be possible to code so that there is a slider on KrossIn/Out and (and not on other machines) which is bound to the "position"parameterIXix wrote:I was wrong about that. I forgot that panning is a property of the machine connections, not the machines, so a pan control on the machine wouldn't make sense.IXix wrote:Same with the panning, you just have to bind a control to the correct machine parameter but I don't know how to access that without some digging.
Re: Solo, bypass (and fader) on Machines?
I think it's possible but it will take more XAML skills than just rigging up a new button.AndersBrontosaurus wrote:would it be possible to code so that there is a slider on KrossIn/Out and (and not on other machines) which is bound to the "position"parameter
You'd have to define your slider as part of the standard machine control then use a data trigger inside the slider style to detect the dll name and set the slider visibility as appropriate. You'd also need to bind the slider value to the appropriate parameter.
Here's a snippet from MachineView.xaml that detects if a machine is a generator and applies the appropriate colour, so you can get an idea of how triggers work...
Code: Select all
<DataTrigger Binding="{Binding Path=Machine.DLL.Info.Type}" Value="Generator">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<SolidColorBrush Color="{Binding Path=Machine.Graph.Buzz.ThemeColors[MV Generator]}"/>
</Setter.Value>
</Setter>
</DataTrigger>
I don't know how you'd go about binding to a machine parameter from XAML but I'd be suprised if you couldn't do it. I could probably figure it out but I can't spare the time right now. I am curious to know whether it would work though so if you can't figure it out yourself, remind me in a couple of weeks and I'll give it a try.
There are a several WPF/XAML tutorials on the web that should get you up to speed with styles and triggers. Good luck and kudos for daring to dive into the code yourself!
- AndersBrontosaurus
- Posts: 516
- Joined: Mon Feb 25, 2013 9:31 am
- Location: Fellingsbro
Re: Solo, bypass (and fader) on Machines?
Thank you for educating me!
I will definitely stick my toes back in the water once I've seen this stubborn flu out but I'm not sure I'm going to as deep as to the calves.
I will definitely stick my toes back in the water once I've seen this stubborn flu out but I'm not sure I'm going to as deep as to the calves.