-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremovedItems.txt
executable file
·253 lines (229 loc) · 14.9 KB
/
removedItems.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
Removed from BankPage
Finalized Bank Load
//IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
//if (isoStore.FileExists(b.finalTrack))
//{
// System.Diagnostics.Debug.WriteLine("File " + b.finalTrack + " exists! t's size is " + b.Size);
// IsolatedStorageFileStream file = isoStore.OpenFile(b.finalTrack, FileMode.Open);
// byte[] buffer;
// using (BinaryReader r = new BinaryReader(file))
// {
// buffer = r.ReadBytes(b.Size);
// }
// viewModel.AudioMan.LoadBank(b.bankID, buffer, b.Size, b.Offset, b.Volume, b.Pitch);
//}
Non-Finalized Bank Load
// IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
// if (isoStore.FileExists(t.fileName))
// {
// System.Diagnostics.Debug.WriteLine("File " + t.fileName + " exists! t's size is " + t.Size);
// IsolatedStorageFileStream file = isoStore.OpenFile(t.fileName, FileMode.Open);
// byte[] buffer;
// using (BinaryReader r = new BinaryReader(file))
// {
// buffer = r.ReadBytes(t.Size);
// }
// viewModel.AudioMan.LoadTrack(b.bankID, t.trackID, buffer, t.Size, t.Offset, t.Latency, t.Volume);
// }
Removed from LoopPage
private void LoadData()
{
foreach (Track t in viewModel.SelectedBank.tracks)
{
if (t.Size > 0)
{
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
if (isoStore.FileExists(t.fileName))
{
System.Diagnostics.Debug.WriteLine("File " + t.fileName + " exists! t's size is " + t.Size);
IsolatedStorageFileStream file = isoStore.OpenFile(t.fileName, FileMode.Open);
byte[] buffer;
using (BinaryReader r = new BinaryReader(file))
{
buffer = r.ReadBytes(t.Size);
}
viewModel.AudioMan.LoadTrack(viewModel.SelectedBank.bankID, t.trackID, buffer, t.Size, t.Offset, t.Latency, t.Volume);
}
}
}
}
// IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
// if (isoStore.FileExists(viewModel.SelectedBank.finalTrack))
// {
// System.Diagnostics.Debug.WriteLine("File " + viewModel.SelectedBank.finalTrack + " exists! t's size is " + viewModel.SelectedBank.Size);
// IsolatedStorageFileStream file = isoStore.OpenFile(viewModel.SelectedBank.finalTrack, FileMode.Open);
// byte[] buffer;
// using (BinaryReader r = new BinaryReader(file))
// {
// buffer = r.ReadBytes(viewModel.SelectedBank.Size);
// }
// viewModel.AudioMan.LoadBank(viewModel.SelectedBank.bankID, buffer, viewModel.SelectedBank.Size, viewModel.SelectedBank.Offset, viewModel.SelectedBank.Volume, viewModel.SelectedBank.Pitch);
// }
<!--
<Storyboard x:Name="FinalizeAnimation">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="trackPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="trackPanel">
<EasingPointKeyFrame KeyTime="0" Value="0.5,0"/>
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.5,1"/>
</PointAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="trackPanel">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:1">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="BankPanel">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="BankPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="BankPanel">
<EasingPointKeyFrame KeyTime="0" Value="0.5,1"/>
<EasingPointKeyFrame KeyTime="0:0:1" Value="0.5,0"/>
</PointAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Name="TrackSelect">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="recPanel">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="recPanel">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:0.2">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="editPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:0.3">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="editPanel">
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
-->
<!--
<Storyboard x:Name="FinishTrack">
<DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="editPanel" d:IsOptimized="True"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="editPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:0.2">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="recPanel">
<DiscreteObjectKeyFrame KeyTime="0:0:0.3">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="recPanel">
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
-->
<Storyboard x:Name="MeasureAnimation">
<DoubleAnimation Duration="0:0:4" To="621" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="progressRect" d:IsOptimized="True"/>
</Storyboard>
<Storyboard x:Name="PageOpened">
<DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="maskingRect" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:0.5" To="-10" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.SkewY)" Storyboard.TargetName="maskingRect" d:IsOptimized="True"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="trackGrid">
<DiscreteObjectKeyFrame KeyTime="0:0:0.5">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="trackGrid">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<!--<StackPanel x:Name="trackPanel" Margin="0,-33,0,14" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2" Grid.RowSpan="2">
<StackPanel.RenderTransform>
<CompositeTransform/>
</StackPanel.RenderTransform>
<Grid>
<TextBlock x:Name="loopListBlock" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Loop List" VerticalAlignment="Top" Margin="{StaticResource PhoneMargin}"/>
<TextBlock Text="{Binding SelectedBank.BankName}" HorizontalAlignment="Right" Margin="{StaticResource PhoneMargin}"/>
</Grid>
<phone:LongListSelector x:Name="loopList" ItemsSource="{Binding SelectedBank.tracks}" HorizontalAlignment="Left" Height="233" VerticalAlignment="Top" SelectionChanged="LongListSelector_SelectionChanged" Width="680" Margin="12,0,0,0" ItemTemplate="{StaticResource LoopItemTemplate}"/>
<StackPanel Height="100" Orientation="Horizontal" Margin="0">
<Button x:Name="continueButton" Visibility="Collapsed" IsEnabled="{Binding Instance.RecButtons, Source={StaticResource MainViewModel}}" Content="Cont" Click="continueButton_Click" Margin="{StaticResource PhoneMargin}"/>
<Button x:Name="stopButton" Visibility="Collapsed" IsEnabled="{Binding Instance.Stop, Source={StaticResource MainViewModel}}" Content="Stop" Click="stopButton_Click" Margin="{StaticResource PhoneMargin}"/>
<Button x:Name="saveButton" Visibility="Visible" Content="Save" Click="saveButton_Click" Margin="{StaticResource PhoneMargin}"/>
<Button x:Name="recOneButton" IsEnabled="{Binding Instance.RecButtons, Source={StaticResource MainViewModel}}" Content="Record" Click="recOneButton_Click" Margin="{StaticResource PhoneMargin}"/>
<Button x:Name="metronomeButton" Content="Metronome" Click="metronomeButton_Click" Margin="{StaticResource PhoneMargin}"/>
<Button x:Name="finalizeButton" IsEnabled="{Binding Instance.RecButtons, Source={StaticResource MainViewModel}}" Content="Finalize" Click="finalizeButton_Click" Margin="{StaticResource PhoneMargin}"/>
</StackPanel>
<Grid Height="44">
<Rectangle x:Name="boundingBox" Stroke="{StaticResource PhoneBorderBrush}" Margin="41,0,0,10" HorizontalAlignment="Left" Width="622"/>
<Rectangle x:Name="progressRect" Stroke="{StaticResource PhoneBorderBrush}" Margin="42,0,0,10" Width="0" HorizontalAlignment="Left" Fill="{Binding Instance.BarColor, Source={StaticResource MainViewModel}}"/>
</Grid>
</StackPanel>-->
//FinalizeAnimation.Begin();
//StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("bank_" + viewModel.SelectedBank.bankID + "_final", CreationCollisionOption.ReplaceExisting);
//using (var s = await file.OpenStreamForWriteAsync())
//{
// s.Write(trackData, 0, trackLength);
//}
//private async void saveButton_Click(object sender, RoutedEventArgs e)
//{
// if (viewModel.SelectedBank.tracks.Count > 0)
// {
// int selBank = viewModel.SelectedBank.bankID;
// foreach (Track t in viewModel.SelectedBank.tracks)
// {
// StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("bank_" + viewModel.SelectedBank.bankID + "_track_" + t.trackID, CreationCollisionOption.ReplaceExisting);
// byte[] trackData;
// int trackLength = viewModel.AudioMan.GetAudioData(viewModel.SelectedBank.bankID, t.trackID, out trackData);
// using (var s = await file.OpenStreamForWriteAsync())
// {
// s.Write(trackData, 0, trackLength);
// }
// t.fileName = file.Path;
// t.Size = trackLength;
// t.Latency = viewModel.AudioMan.GetTrackLatency(selBank, t.trackID);
// t.Offset = viewModel.AudioMan.GetOffsetMS(selBank, t.trackID);
// t.Volume = viewModel.AudioMan.GetVolumeDB(selBank, t.trackID);
// }
// }
//}
//if (!settings.Contains("projects"))
//{
// settings["projects"] = new ObservableCollection<Project>();
// ((ObservableCollection<Project>)settings["projects"]).Add(new Project("Project One"));
// ((ObservableCollection<Project>)settings["projects"])[0].banks.Add(new Bank() { bankID = 0 });
//}
//viewModel.SelectedProject = ((ObservableCollection<Project>)settings["projects"])[0];
//viewModel.SelectedBank = viewModel.SelectedProject.banks[0];
//IsolatedStorageSettings.ApplicationSettings.Save();