Skip to content

Commit

Permalink
Merge pull request #14 from jwallet/dev
Browse files Browse the repository at this point in the history
Translate
  • Loading branch information
jwallet authored Aug 31, 2017
2 parents 48010df + e3d4ec0 commit ccdeae7
Show file tree
Hide file tree
Showing 21 changed files with 1,845 additions and 168 deletions.
Binary file modified .vs/EspionSpotify/v14/.suo
Binary file not shown.
3 changes: 3 additions & 0 deletions EspionSpotify/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<setting name="AddNumsAsTrack" serializeAs="String">
<value>False</value>
</setting>
<setting name="Language" serializeAs="String">
<value>0</value>
</setting>
</EspionSpotify.Properties.Settings>
</userSettings>
</configuration>
41 changes: 38 additions & 3 deletions EspionSpotify/EspionSpotify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
<AssemblyName>EspionSpotify</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publier\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -111,12 +126,24 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="english.Designer.cs">
<DependentUpon>english.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="french.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>french.resx</DependentUpon>
</Compile>
<Compile Include="LanguageType.cs" />
<Compile Include="normalize.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
<Compile Include="Song.cs" />
<Compile Include="Recorder.cs" />
<Compile Include="frmEspionSpotify.cs">
Expand All @@ -129,13 +156,22 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VolumeWin.cs" />
<Compile Include="Watcher.cs" />
<EmbeddedResource Include="english.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>english.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="french.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>french.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="frmEspionSpotify.resx">
<DependentUpon>frmEspionSpotify.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
Expand All @@ -155,12 +191,12 @@
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>True</Install>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>True</Install>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
Expand All @@ -175,7 +211,6 @@
<None Include="Resources\voldown.gif" />
<None Include="Resources\pause.gif" />
<None Include="Resources\clear.gif" />
<None Include="Resources\volume.gif" />
<None Include="Resources\plus.gif" />
<None Include="Resources\play.gif" />
<None Include="Resources\on.gif" />
Expand Down
8 changes: 8 additions & 0 deletions EspionSpotify/EspionSpotify.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
<ProjectView>ProjectFiles</ProjectView>
<PublishUrlHistory>publier\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>fr-FR</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions EspionSpotify/LanguageType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace EspionSpotify
{
public enum LanguageType
{
En = 0,
Fr
}
}
1 change: 0 additions & 1 deletion EspionSpotify/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
Expand Down
12 changes: 12 additions & 0 deletions EspionSpotify/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions EspionSpotify/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
<Setting Name="AddNumsAsTrack" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Language" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
18 changes: 9 additions & 9 deletions EspionSpotify/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum Format { Mp3, Wav };
private readonly bool _strucDossiers;
private readonly int _compteur;
private readonly bool _bCdTrack;
private readonly FrmEspionSpotify _espionSpotifyForm;
private readonly FrmEspionSpotify _form;
private readonly Format _format;
private readonly Song _song;
public WasapiLoopbackCapture WaveIn;
Expand All @@ -37,7 +37,7 @@ public Recorder(FrmEspionSpotify espionSpotifyForm, string path, LAMEPreset bitr
Song song, int minTime, bool strucDossiers, string charSeparator, bool bCdTrack, int compteur)
{
SongGotDeleted = false;
_espionSpotifyForm = espionSpotifyForm;
_form = espionSpotifyForm;
_path = path;
_bitrate = bitrate;
_format = format;
Expand All @@ -59,16 +59,14 @@ public void Run()

if (Writer == null)
{
_espionSpotifyForm.WriteIntoConsole(
"//Erreur lors de l'enregistrement: Format audio de votre ordinateur non supporté. Le format doit" +
" être '2 canaux, 24 bit, 48000 Hz (Studio Quality)' (Panneau de configuration > Son > Propriétés > Avancés).");
_form.WriteIntoConsole(_form.Rm.GetString("logWriterIsNull"));
return;
}

WaveIn.StartRecording();

Thread.Sleep(400);
_espionSpotifyForm.WriteIntoConsole($"Enregistrement de: {GetFileName(_path, _song, _format, false)}");
_form.WriteIntoConsole(string.Format(_form.Rm.GetString("logRecording"), GetFileName(_path, _song, _format, false)));

while (Running)
{
Expand All @@ -95,9 +93,11 @@ private void waveIn_RecordingStopped(object sender, StoppedEventArgs e)

if (Count >= _minTime) return;

_espionSpotifyForm.WriteIntoConsole(Count != -1
? $"//Effacement de: {GetFileName(_path, _song, _format, false)} [<{_minTime}s]"
: $"//Effacement de: {GetFileName(_path, _song, _format, false)}");
_form.WriteIntoConsole(Count != -1
? string.Format(_form.Rm.GetString("logDeletingTooShort"),
GetFileName(_path, _song, _format, false), _minTime)
: string.Format(_form.Rm.GetString("logDeleting"),
GetFileName(_path, _song, _format, false)));

File.Delete(GetFileName(_path, _song, _format, true, true));
}
Expand Down
Binary file modified EspionSpotify/Resources/espion-spotify-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added EspionSpotify/Resources/logo_en.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified EspionSpotify/Resources/spytify-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions EspionSpotify/Settings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace EspionSpotify.Properties {


// Cette classe vous permet de gérer des événements spécifiques dans la classe de paramètres :
// L'événement SettingChanging est déclenché avant la modification d'une valeur de paramètre.
// L'événement PropertyChanged est déclenché après la modification d'une valeur de paramètre.
// L'événement SettingsLoaded est déclenché après le chargement des valeurs de paramètre.
// L'événement SettingsSaving est déclenché avant l'enregistrement des valeurs de paramètre.
internal sealed partial class Settings {

public Settings() {
// // Pour ajouter des gestionnaires d'événements afin d'enregistrer et de modifier les paramètres, supprimez les marques de commentaire des lignes ci-dessous :
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}

private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Ajouter du code pour gérer l'événement SettingChangingEvent ici.
}

private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Ajouter du code pour gérer l'événement SettingsSaving ici.
}
}
}
12 changes: 6 additions & 6 deletions EspionSpotify/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void Run()
Running = true;
_waitOneSec = 0;

_form.WriteIntoConsole("//Début de l\'espionnage.");
_form.WriteIntoConsole(_form.Rm.GetString("logStarting"));

SpotifyStatusBeforeSpying();

Expand All @@ -94,7 +94,7 @@ public void Run()

if (_recorder != null) DoIKeepLastSong(true);

_form.WriteIntoConsole("//Fin de l\'espionnage.");
_form.WriteIntoConsole(_form.Rm.GetString("logStoping"));
_form.UpdateStartButton();
_form.UpdatePlayingTitle("Spotify");
Ready = true;
Expand All @@ -112,14 +112,14 @@ private void SpotifyStatusBeforeSpying()
{
if (_title == null)
{
_form.WriteIntoConsole("//Veuillez démarrer l\'application Spotify.");
_form.WriteIntoConsole(_form.Rm.GetString("logSpotifyNotRunning"));
Running = false;
}
else
{
if (_title != "Spotify")
{
_form.WriteIntoConsole("//En attente du prochain titre...");
_form.WriteIntoConsole(_form.Rm.GetString("logWaiting"));
_bWait = true;
}
else
Expand Down Expand Up @@ -168,7 +168,7 @@ private void RecordSpotify()

if (SoundDetected())
{
_form.WriteIntoConsole($"Publicité: {_title}");
_form.WriteIntoConsole(string.Format(_form.Rm.GetString("logCommercialBreak"), _title));
}
}

Expand Down Expand Up @@ -197,7 +197,7 @@ private void RecordSpotify()

if (SpotifyClosedOrCrashed)
{
_form.WriteIntoConsole("//Spotify est fermé.");
_form.WriteIntoConsole(_form.Rm.GetString("logSpotifyIsClosed"));

if (_recorder != null)
{
Expand Down
Loading

0 comments on commit ccdeae7

Please sign in to comment.