|
|
|
|
@ -8,7 +8,6 @@ using System.Collections.ObjectModel; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using Avalonia.Controls; |
|
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
|
using Lib.Driver; |
|
|
|
|
using Mystify.Views; |
|
|
|
|
using ReactiveUI; |
|
|
|
|
@ -33,27 +32,6 @@ namespace Mystify.ViewModels |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ObservableCollection<ChannelViewModel>? Channels => _mainModel?.Channels?.Select(c => new ChannelViewModel(c, _mainWindow, _mainModel)).ToObservableCollection(); |
|
|
|
|
public List<IControllable>? Controllables => _mainModel?.Controllables; |
|
|
|
|
|
|
|
|
|
public ChannelViewModel? SelectedChannel |
|
|
|
|
{ |
|
|
|
|
get => _mainModel?.SelectedChannel == null ? null : new ChannelViewModel(_mainModel.SelectedChannel, _mainWindow, _mainModel); |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
if (_mainModel != null) |
|
|
|
|
_mainModel.SelectedChannel = value?.Channel; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IControllable? SelectedControllable |
|
|
|
|
{ |
|
|
|
|
get => _mainModel?.SelectedControllable; |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
if (_mainModel != null) |
|
|
|
|
_mainModel.SelectedControllable = value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool UseMidiView |
|
|
|
|
{ |
|
|
|
|
@ -80,15 +58,8 @@ namespace Mystify.ViewModels |
|
|
|
|
|
|
|
|
|
RaisePropertyChanged(() => SelectedDeviceText); |
|
|
|
|
RaisePropertyChanged(() => Channels); |
|
|
|
|
RaisePropertyChanged(() => Controllables); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
public ICommand MapControllableCommand => ReactiveCommand.Create(() => _mainModel?.MapControllable()); |
|
|
|
|
|
|
|
|
|
public void UpdateChannelsAndControllables() |
|
|
|
|
{ |
|
|
|
|
RaisePropertyChanged(() => Channels); |
|
|
|
|
RaisePropertyChanged(() => Controllables); |
|
|
|
|
} |
|
|
|
|
public void UpdateChannels() => RaisePropertyChanged(() => Channels); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|