-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added extended capability ID_CAP_SOUND_CONTROL (for the ARM release) some minor fixes and improvements
- Loading branch information
1 parent
7c2e6bb
commit b8e44b9
Showing
20 changed files
with
610 additions
and
67 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,137 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace WPTweaker | ||
{ | ||
class EmulatorData | ||
{ | ||
#if !ARM | ||
public static List<string> SoundFiles = new List<string>() | ||
{ | ||
"1_VZW_Airwaves.wma", "2_VZW_ Cube.wma", "AchievementNotifyPopup.wav", "Ahh Glitch.wma", "Alarm-01.wma", "Alarm-02.wma", | ||
"Alarm-03.wma", "Alarm-04.wma", "Alarm-05.wma", "Alarm-06.wma", "Alert-01.wma", "Alert-02.wma", "Alert-03.wma", "Alert-04.wma", | ||
"Alert-05.wma", "Alert-06.wma", "Alert-07.wma", "Alert-08.wma", "Alert-09.wma", "Alert-10.wma", "Alert_calendar.wma", "Alert_charging.wma", | ||
"Alert_find_phone.wma", "Alert_low_battery.wma", "Alert_nudge.wma", "Applebite.wma", "Bird Box.wma", "Bouncey Bounce.wma", "Brikabrak.wma", | ||
"Brimful.wma", "Broken Tone.wma", "Busy.wav", "BusyCDMA.wav", "BusyCDMA_Nokia.wav", "Busy_Nokia.wav", "Calldrop.wav", "Calldrop_Nokia.wav", | ||
"Callwait.wav", "Callwait_Nokia.wav", "Cat.wma", "Chipper.wma", "Circles.wma", "CMAS.wma", "Congestion.wav", "Congestion_Nokia.wav", | ||
"CopyPaste.wav", "Default.wav", "Dewdrop.wma", "Digital Thump.wma", "Disconnct.wav", "dtmf0.wav", "dtmf1.wav", "dtmf2.wav", "dtmf3.wav", | ||
"dtmf4.wav", "dtmf5.wav", "dtmf6.wav", "dtmf7.wav", "dtmf8.wav", "dtmf9.wav", "dtmfast.wav", "dtmfpd.wav", "Earl's Torch.wma", | ||
"Good Times.wma", "HWandSW.wav", "ImeAddToDictionary.wav", "ImeBluebirdOOV.wav", "ImeSelectCandidate.wav", "InCallBuzz.wma", | ||
"Just Ice.wma", "KbdAccentPicker.wav", "KbdFunction.wav", "KbdKeyTap.wav", "KbdSpacebar.wav", "lock.wav", "Lucky Five.wma", | ||
"Macro.wma", "Marbles.wma", "Miniature of Troy.wma", "Moanday.wma", "NfcInRange.wma", "NfcPaymentFail.wma", "NfcPaymentSuccess.wma", | ||
"NfcTransactionComplete.wma", "Nokia calendar.wma", "Nokia clock.wma", "Nokia email.wma", "Nokia message.wma", "Nokia Tune Remix.wma", | ||
"Nokia Tune.wma", "Nostalgia.wma", "Pinball.wma", "PingRing.wav", "Pip.wav", "Pool.wma", "Remind.wma", "Reorder.wav", "Reorder_Nokia.wav", | ||
"Ring01.wma", "Ring02.wma", "Ring03.wma", "Ring04.wma", "Ring05.wma", "Ring06.wma", "Ring07.wma", "Ring08.wma", "Ring09.wma", "Ring10.wma", | ||
"Ring11.wma", "Ring12.wma", "Ring13.wma", "Ring14.wma", "Ring15.wma", "Ring16.wma", "Ring17.wma", "Ring18.wma", "Ring19.wma", "Ring20.wma", | ||
"Ring21.wma", "ringback.wav", "Ruby.wma", "Skate.wma", "Slow Coffee.wma", "Standard.wav", "Sweets.wma", "unlock.wav", "Voiceprvcy.wav", | ||
"Warped.wma", "WiFiConnected.wav", "WiFiDisconnected.wav" | ||
}; | ||
|
||
|
||
public static Dictionary<string, string> NotificationEventValues = new Dictionary<string, string>() | ||
{ | ||
{ "Achievement", @"C:\Programs\CommonFiles\Sounds\AchievementNotifyPopup.wav" }, | ||
{ "Alarm", @"C:\Programs\CommonFiles\Sounds\Alarm-01.wma" }, | ||
{ "BatteryCharging", @"C:\Programs\CommonFiles\Sounds\Alert_charging.wma" }, | ||
{ "BusyCDMA", @"C:\Programs\CommonFiles\Sounds\BusyCDMA_Nokia.wav" }, | ||
{ "BusyTone", @"C:\Programs\CommonFiles\Sounds\Busy_Nokia.wav" }, | ||
{ "CallDrop", @"C:\Programs\CommonFiles\Sounds\Calldrop_Nokia.wav" }, | ||
{ "CallWaiting", @"C:\Programs\CommonFiles\Sounds\Callwait_Nokia.wav" }, | ||
{ "Camera", @"" }, | ||
{ "CellBroadcast", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "Clock", @"C:\Programs\CommonFiles\Sounds\Alarm-01.wma" }, | ||
{ "CMAS", @"C:\Programs\CommonFiles\Sounds\CMAS.wma" }, | ||
{ "Congestion", @"C:\Programs\CommonFiles\Sounds\Congestion_Nokia.wav" }, | ||
{ "CopyPaste", @"C:\Programs\CommonFiles\Sounds\CopyPaste.wav" }, | ||
{ "DownloadComplete", @"*none*" }, | ||
{ "Dtmf#", @"C:\Programs\CommonFiles\Sounds\Dtmfpd.wav" }, | ||
{ "Dtmf*", @"C:\Programs\CommonFiles\Sounds\Dtmfast.wav" }, | ||
{ "Dtmf0", @"C:\Programs\CommonFiles\Sounds\Dtmf0.wav" }, | ||
{ "Dtmf1", @"C:\Programs\CommonFiles\Sounds\Dtmf1.wav" }, | ||
{ "Dtmf2", @"C:\Programs\CommonFiles\Sounds\Dtmf2.wav" }, | ||
{ "Dtmf3", @"C:\Programs\CommonFiles\Sounds\Dtmf3.wav" }, | ||
{ "Dtmf4", @"C:\Programs\CommonFiles\Sounds\Dtmf4.wav" }, | ||
{ "Dtmf5", @"C:\Programs\CommonFiles\Sounds\Dtmf5.wav" }, | ||
{ "Dtmf6", @"C:\Programs\CommonFiles\Sounds\Dtmf6.wav" }, | ||
{ "Dtmf7", @"C:\Programs\CommonFiles\Sounds\Dtmf7.wav" }, | ||
{ "Dtmf8", @"C:\Programs\CommonFiles\Sounds\Dtmf8.wav" }, | ||
{ "Dtmf9", @"C:\Programs\CommonFiles\Sounds\Dtmf9.wav" }, | ||
{ "E-mail", @"C:\Programs\CommonFiles\Sounds\Alert-08.wma" }, | ||
{ "FindPhone", @"C:\Programs\CommonFiles\Sounds\Alert_find_phone.wma" }, | ||
{ "IM", @"C:\Programs\CommonFiles\Sounds\Alert-10.wma" }, | ||
{ "ImeAddToDictionary", @"ImeAddToDictionary.wav" }, | ||
{ "ImeBluebirdOOV", @"ImeBluebirdOOV.wav" }, | ||
{ "ImeSelectCandidate", @"ImeSelectCandidate.wav" }, | ||
{ "InCallBuzz", @"C:\Programs\CommonFiles\Sounds\InCallBuzz.wma" }, | ||
{ "InCallDtmf#", @"C:\Programs\CommonFiles\Sounds\Dtmfpd.wav" }, | ||
{ "InCallDtmf*", @"C:\Programs\CommonFiles\Sounds\Dtmfast.wav" }, | ||
{ "InCallDtmf0", @"C:\Programs\CommonFiles\Sounds\Dtmf0.wav" }, | ||
{ "InCallDtmf1", @"C:\Programs\CommonFiles\Sounds\Dtmf1.wav" }, | ||
{ "InCallDtmf2", @"C:\Programs\CommonFiles\Sounds\Dtmf2.wav" }, | ||
{ "InCallDtmf3", @"C:\Programs\CommonFiles\Sounds\Dtmf3.wav" }, | ||
{ "InCallDtmf4", @"C:\Programs\CommonFiles\Sounds\Dtmf4.wav" }, | ||
{ "InCallDtmf5", @"C:\Programs\CommonFiles\Sounds\Dtmf5.wav" }, | ||
{ "InCallDtmf6", @"C:\Programs\CommonFiles\Sounds\Dtmf6.wav" }, | ||
{ "InCallDtmf7", @"C:\Programs\CommonFiles\Sounds\Dtmf7.wav" }, | ||
{ "InCallDtmf8", @"C:\Programs\CommonFiles\Sounds\Dtmf8.wav" }, | ||
{ "InCallDtmf9", @"C:\Programs\CommonFiles\Sounds\Dtmf9.wav" }, | ||
{ "InCallVoiceText", @"C:\Programs\CommonFiles\Sounds\Callwait.wav" }, | ||
{ "Infbeg", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "Infend", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "InfInt", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "Interrupt", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "Keypress", @"C:\Programs\CommonFiles\Sounds\HWandSW.wav" }, | ||
{ "KnownCallerRing0", @"" }, | ||
{ "LoudestInCallVolume", @"" }, | ||
{ "Lowbattery", @"C:\Programs\CommonFiles\Sounds\Alert_low_battery.wma" }, | ||
{ "Mail", @"C:\Programs\CommonFiles\Sounds\Alert-08.wma" }, | ||
{ "Netbegin", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "Netend", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "NetInt", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "NetworkDrop", @"C:\Programs\CommonFiles\Sounds\Calldrop_Nokia.wav" }, | ||
{ "NfcInRange", @"C:\Programs\CommonFiles\Sounds\NfcInRange.wma" }, | ||
{ "NfcPaymentFail", @"C:\Programs\CommonFiles\Sounds\NfcPaymentFail.wma" }, | ||
{ "NfcPaymentSuccess", @"C:\Programs\CommonFiles\Sounds\NfcPaymentSuccess.wma" }, | ||
{ "NfcTransactionComplete", @"C:\Programs\CommonFiles\Sounds\NfcTransactionComplete.wma" }, | ||
{ "NfcTransactionCompleteShort", @"C:\Programs\CommonFiles\Sounds\NfcTransactionComplete.wma" }, | ||
{ "Notification", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "NotificationToast", @"C:\Programs\CommonFiles\Sounds\Alert-05.wma" }, | ||
{ "Password", @"*none*" }, | ||
{ "PhoneLocked", @"C:\Programs\CommonFiles\Sounds\lock.wav" }, | ||
{ "PhoneUnlocked", @"C:\Programs\CommonFiles\Sounds\unlock.wav" }, | ||
{ "PhotoScroll", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "PingRing", @"C:\Programs\CommonFiles\Sounds\PingRing.wav" }, | ||
{ "Pip", @"C:\Programs\CommonFiles\Sounds\PIP.wav" }, | ||
{ "Reminder", @"C:\Programs\CommonFiles\Sounds\Nokia calendar.wma" }, | ||
{ "Reorder", @"C:\Programs\CommonFiles\Sounds\Reorder_Nokia.wav" }, | ||
{ "Ringback", @"C:\Programs\CommonFiles\Sounds\ringback.wav" }, | ||
{ "Ringout", @"C:\Programs\CommonFiles\Sounds\Callwait.wav" }, | ||
{ "RingPreview", @"" }, | ||
{ "RingTone", @"C:\Programs\CommonFiles\Sounds\2_VZW_ Cube.wma" }, | ||
{ "RingVoiceText", @"C:\Programs\CommonFiles\Sounds\Ring01.wma" }, | ||
{ "ScreenOff", @"C:\Programs\CommonFiles\Sounds\lock.wav" }, | ||
{ "ScreenOn", @"C:\Programs\CommonFiles\Sounds\unlock.wav" }, | ||
{ "Shutdown", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "SMS", @"C:\Programs\CommonFiles\Sounds\Nokia message.wma" }, | ||
{ "SMSNudge", @"C:\Programs\CommonFiles\Sounds\Alert_nudge.wma" }, | ||
{ "StartButton", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemAsterisk", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemDefault", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemExclamation", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemHand", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemQuestion", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "SystemStart", @"*none*" }, | ||
{ "Toolkit", @"C:\Programs\CommonFiles\Sounds\default.wav" }, | ||
{ "TransferComplete", @"C:\Programs\CommonFiles\Sounds\transfercomplete.wav" }, | ||
{ "VoiceMail", @"C:\Programs\CommonFiles\Sounds\Nokia email.wma" }, | ||
{ "VoicePrivacyDrop", @"C:\Programs\CommonFiles\Sounds\voiceprvcy.wav" }, | ||
{ "Warning", @"C:\Programs\CommonFiles\Sounds\Remind.wma" }, | ||
{ "WiFiConnected", @"C:\Programs\CommonFiles\Sounds\WiFiConnected.wav" }, | ||
{ "WiFiDisconnected", @"C:\Programs\CommonFiles\Sounds\WiFiDisconnected.wav" }, | ||
}; | ||
#endif | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<UserControl | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" x:Class="WPTweaker.RingtoneChooser" | ||
mc:Ignorable="d" | ||
FontFamily="{StaticResource PhoneFontFamilyNormal}" | ||
FontSize="{StaticResource PhoneFontSizeNormal}" | ||
Foreground="{StaticResource PhoneForegroundBrush}" | ||
d:DesignHeight="80" d:DesignWidth="480" Loaded="RingtoneChooser_Loaded"> | ||
|
||
<Grid> | ||
<MediaElement x:Name="mediaElement" Volume="1" Visibility="Collapsed" BufferingTime="0:1:0" /> | ||
<ListBox x:Name="RingtoneList" Height="580" SelectionChanged="RingtoneList_SelectionChanged" Margin="0,20,0,0"> | ||
<ListBox.ItemTemplate> | ||
<DataTemplate> | ||
<StackPanel Orientation="Horizontal" Margin="0,10"> | ||
<Image Source="{Binding ImageSource}" Width="48" Stretch="Uniform" HorizontalAlignment="Center" Margin="10" Tap="Image_Tap" /> | ||
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" FontSize="32" Margin="10,-4,0,0" /> | ||
</StackPanel> | ||
</DataTemplate> | ||
</ListBox.ItemTemplate> | ||
</ListBox> | ||
</Grid> | ||
</UserControl> |
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,108 @@ | ||
// Used source code from https://github.com/jessenic/wph-tweaks/blob/master/HomebrewHelperWP/Filesystem/RingtoneChooser.xaml.cs | ||
// by Jaxbot, by jessenic | ||
// | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.IO; | ||
using System.IO.IsolatedStorage; | ||
using System.Runtime.CompilerServices; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Controls.Primitives; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.ComponentModel; | ||
|
||
namespace WPTweaker | ||
{ | ||
public partial class RingtoneChooser : UserControl | ||
{ | ||
public string SelectedRingtone { get; set; } | ||
|
||
IsolatedStorageFile isfStore = IsolatedStorageFile.GetUserStoreForApplication(); | ||
string _isfRootPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path; | ||
|
||
public RingtoneChooser() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void Image_Tap(object sender, GestureEventArgs e) | ||
{ | ||
var file = (RingtoneListItem)((Image)sender).DataContext; | ||
if (file != null && !file.DisplayName.Contains("none")) | ||
{ | ||
#if ARM | ||
string fileName = file.DisplayName + ".tmp"; | ||
try | ||
{ | ||
// Copy file to the isf | ||
File.Copy(file.FullPath, Path.Combine(_isfRootPath, fileName), true); | ||
using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(fileName, FileMode.Open, isfStore)) | ||
{ | ||
mediaElement.SetSource(stream); | ||
mediaElement.Play(); | ||
} | ||
isfStore.DeleteFile(fileName); | ||
} | ||
catch { } | ||
#else | ||
MessageBox.Show(file.FullPath); | ||
#endif | ||
} | ||
} | ||
|
||
private void RingtoneChooser_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
RingtoneListItem item = new RingtoneListItem("none"); | ||
RingtoneList.Items.Add(item); | ||
if (this.SelectedRingtone != null && this.SelectedRingtone.ToLower().Equals("none")) | ||
{ | ||
this.RingtoneList.SelectedItem = item; | ||
} | ||
#if ARM | ||
string[] sourceDirs = new string[] { "C:\\Data\\Users\\Public\\Ringtones", "C:\\Programs\\CommonFiles\\Sounds" }; | ||
#else | ||
string[] sourceDirs = new string[] { "C:\\Programs\\CommonFiles\\Sounds" }; | ||
#endif | ||
foreach (var dir in sourceDirs) | ||
{ | ||
#if ARM | ||
string[] files = Directory.GetFiles(dir, "*.*"); | ||
#else | ||
string[] files = EmulatorData.SoundFiles.Select(f => Path.Combine(dir, f)).ToArray(); | ||
#endif | ||
foreach (var str in files) | ||
{ | ||
item = new RingtoneListItem(str); | ||
RingtoneList.Items.Add(item); | ||
if (this.SelectedRingtone != null && str.Equals(this.SelectedRingtone, StringComparison.InvariantCultureIgnoreCase)) | ||
{ | ||
this.RingtoneList.SelectedItem = item; | ||
} | ||
} | ||
} | ||
} | ||
|
||
private void RingtoneList_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
if (RingtoneList.SelectedItem != null) | ||
{ | ||
SelectedRingtone = ((RingtoneListItem)this.RingtoneList.SelectedItem).FullPath; | ||
} | ||
} | ||
|
||
public class RingtoneListItem | ||
{ | ||
public string DisplayName { get; set; } | ||
public string FullPath { get; set; } | ||
public string ImageSource | ||
{ | ||
get { return DisplayName.Contains("none") ? "/Assets/AppBar/none.png" : "/Assets/AppBar/play.png"; } | ||
} | ||
public RingtoneListItem(string fullPath) { DisplayName = Path.GetFileNameWithoutExtension(fullPath); FullPath = fullPath; } | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.