forked from andulv/RSTabExplorer
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using AlphaTab.Platform.CSharp.Wpf; | ||
using System.Windows; | ||
|
||
namespace RockSmithTabExplorer | ||
{ | ||
public class TabControl : AlphaTabImage | ||
{ | ||
public static DependencyProperty ZoomEnabledProperty = | ||
DependencyProperty.Register("ZoomEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(false, OnZoomModeChanged)); | ||
|
||
public TabControl() : base() | ||
{ | ||
} | ||
|
||
public bool ZoomEnabled | ||
{ | ||
get { return (bool)GetValue(ZoomEnabledProperty); } | ||
set { SetValue(ZoomEnabledProperty, value); } | ||
} | ||
|
||
private static void OnZoomModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
var tab = (TabControl)d; | ||
if ((bool)e.NewValue) | ||
{ | ||
tab.EnableZoomMode(); | ||
} | ||
else | ||
{ | ||
tab.DisableZoomMode(); | ||
} | ||
|
||
tab.InvalidateTrack(); | ||
} | ||
|
||
private bool showScore = true; | ||
private bool ShowScore | ||
{ | ||
get { return showScore; } | ||
set | ||
{ | ||
if (showScore == value) | ||
return; | ||
showScore = value; | ||
if (value) | ||
Settings.Staves.Add(new AlphaTab.StaveSettings("score")); | ||
else | ||
Settings.Staves.RemoveAt(Settings.Staves.FindIndex(s => s.Id == "score")); | ||
} | ||
} | ||
|
||
|
||
public void EnableZoomMode() | ||
{ | ||
ShowScore = false; | ||
Settings.Scale = 0.9f; | ||
//Settings.Width = 1300;//950; | ||
|
||
// Layout Settings | ||
var layoutSettings = new AlphaTab.Collections.FastDictionary<string, object>(); | ||
//layoutSettings["autoSize"] = false; | ||
layoutSettings["barsPerRow"] = 4; | ||
Settings.Layout.AdditionalSettings = layoutSettings; | ||
|
||
//Settings.Staves.Add(new StaveSettings("rhythm-up")); | ||
} | ||
|
||
public void DisableZoomMode() | ||
{ | ||
ShowScore = true; | ||
Settings.Scale = 1f; | ||
Settings.Layout.AdditionalSettings = new AlphaTab.Collections.FastDictionary<string, object>(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters