Skip to content

Commit

Permalink
Merge pull request #9 from timweiss/logo-and-improvements
Browse files Browse the repository at this point in the history
New logo and improvements
  • Loading branch information
timweiss authored Jan 20, 2018
2 parents fcb0d2a + 597d1d5 commit cbbc0be
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LunaticPlayer.GRadioAPI/Classes/Song.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Song
public string AlbumArtFilename { get; set; }
public string CirleArtFilename { get; set; }

public string CircleArtist => $"{ArtistName} ({CircleName})";
public string CircleArtist => ArtistName == CircleName ? ArtistName : $"{ArtistName} ({CircleName})";

[JsonIgnore]
public BitmapImage AlbumArt { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion LunaticPlayer.GRadioAPI/IApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public interface IApiClient
/// <returns>Current song</returns>
Song PlayingSong();
}
}
}
14 changes: 7 additions & 7 deletions LunaticPlayer/LunaticPlayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\gr_icon_new.ico</ApplicationIcon>
<ApplicationIcon>Resources\logo-new-05x.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="GlobalHotKey, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
Expand Down Expand Up @@ -190,15 +190,9 @@
<ItemGroup>
<Resource Include="Resources\settings_92.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\gr_icon_new.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\gr-album-fallback.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\gr_icon_new.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\close_128.png" />
</ItemGroup>
Expand Down Expand Up @@ -240,6 +234,12 @@
<ItemGroup>
<Resource Include="Resources\lp-copy-92.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\logo-new-05x.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\logo-new-05x.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
10 changes: 9 additions & 1 deletion LunaticPlayer/PlayerInterface.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ private void MuteButton_Click(object sender, RoutedEventArgs e)
private void SongInfoButton_Click(object sender, RoutedEventArgs e)
{
if (_detailsWindow != null && _detailsWindow.IsVisible)
{
_detailsWindow.Focus();
return;
}

_detailsWindow = new SongDetailsWindow(_currentSong);
_detailsWindow.Show();
Expand All @@ -223,7 +226,10 @@ private void SongInfoButton_Click(object sender, RoutedEventArgs e)
private void OptionsButton_OnClick(object sender, RoutedEventArgs e)
{
if (_settingsWindow != null && _settingsWindow.IsVisible)
{
_settingsWindow.Focus();
return;
}

_settingsWindow = new SettingsWindow(_songManager.SongHistory.Database, _mediaKeyHook);
_settingsWindow.Show();
Expand All @@ -232,8 +238,10 @@ private void OptionsButton_OnClick(object sender, RoutedEventArgs e)
private void SongListButton_OnClick(object sender, RoutedEventArgs e)
{
if (_historyWindow != null && _historyWindow.IsVisible)
{
_historyWindow.Focus();
return;

}

_historyWindow = new SongHistoryWindow(_songManager.SongHistory);
_historyWindow.Show();
Expand Down
Binary file removed LunaticPlayer/Resources/gr_icon_new.ico
Binary file not shown.
Binary file removed LunaticPlayer/Resources/gr_icon_new.png
Binary file not shown.
Binary file added LunaticPlayer/Resources/logo-new-05x.ico
Binary file not shown.
Binary file added LunaticPlayer/Resources/logo-new-05x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion LunaticPlayer/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</Border.Triggers>
<StackPanel>
<Border Padding="15">
<Image RenderOptions.BitmapScalingMode="Fant" Source="Resources/gr_icon_new.png">
<Image RenderOptions.BitmapScalingMode="Fant" Source="Resources/logo-new-05x.png">
<Image.Effect>
<DropShadowEffect x:Name="LogoDropShadow" Direction="-90" BlurRadius="20" Opacity="0.2" ShadowDepth="10"/>
</Image.Effect>
Expand Down Expand Up @@ -57,6 +57,13 @@
<TextBlock Foreground="#FFB8B8B8" Text="Couldn't register media hotkeys, click button to try again" />
<Button Style="{DynamicResource WhiteButton}" Margin="0,5,0,0" Height="25" Click="RegisterMediaHotkeys">Register media hotkeys</Button>
</StackPanel>
<StackPanel Name="FolderPanel" Margin="0,10,0,0">
<TextBlock Foreground="#FFEAEAEA" FontSize="18">App Folder</TextBlock>

<TextBlock Foreground="#FFB8B8B8" Text="Cover images and application files are stored here" />
<Button Style="{DynamicResource WhiteButton}" Margin="0,5,0,0" Height="25" Click="OpenDataFolder_Click">Open data folder</Button>
<Button Name="AppFolderButton" Style="{DynamicResource WhiteButton}" Margin="0,5,0,0" Height="25" Click="OpenAppFolder_Click">Open application folder</Button>
</StackPanel>
<StackPanel Name="LegalPanel" Margin="0,10,0,0">
<TextBlock Foreground="#FFEAEAEA" FontSize="18">Legal + Attributions</TextBlock>
<TextBlock Foreground="#FFB8B8B8" FontSize="11">Content provided by <Hyperlink NavigateUri="https://gensokyoradio.net" RequestNavigate="Hyperlink_RequestNavigate" Foreground="#FFB8B8B8" >Gensokyo Radio</Hyperlink></TextBlock>
Expand Down
26 changes: 23 additions & 3 deletions LunaticPlayer/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using LunaticPlayer.Client;
using LunaticPlayer.Player;
using LunaticPlayer.Windows;
using Path = System.IO.Path;

namespace LunaticPlayer
{
Expand Down Expand Up @@ -99,6 +100,9 @@ private void ReloadData()

if (_mediaKeyHook.KeysRegistered)
HotkeyPanel.Visibility = Visibility.Collapsed;

if (AppPathEqualsDataPath())
AppFolderButton.Visibility = Visibility.Collapsed;
}

private void DeleteAllCoverImagesButton_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -140,14 +144,12 @@ private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e

private void DeleteDatabaseEntriesButton_Click(object sender, RoutedEventArgs e)
{
Console.WriteLine("Deleting all songs from SongHistory");
_database.RemoveAllSongs();
ReloadData();
}

private void DeleteDatabaseEntriesTodayButton_Click(object sender, RoutedEventArgs e)
{
Console.WriteLine("Deleting all songs of today from SongHistory");
_database.RemoveSongsOfToday();
ReloadData();
}
Expand All @@ -164,7 +166,7 @@ private void RegisterMediaHotkeys(object sender, RoutedEventArgs e)
ReloadData();

if(!_mediaKeyHook.KeysRegistered)
ShowDialogWindow("Error", "Could not register hotkeys. Make sure no other instance of LunaticPlayer is running.", true);
ShowDialogWindow("Error", "Could not register hotkeys. Make sure no other instance of Lunatic Player is running.", true);
}

private void ShowDialogWindow(string title, string message, bool showAsDialog)
Expand All @@ -185,5 +187,23 @@ private void ShowDialogWindow(string title, string message, bool showAsDialog)
window.Show();
}
}

private void OpenAppFolder_Click(object sender, RoutedEventArgs e)
{
Process.Start(System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName);
}

private bool AppPathEqualsDataPath()
{
var appPath = new Uri(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName.TrimEnd('/', '\\'));
var dataPath = new Uri(Path.GetFullPath(_basePath).TrimEnd('/', '\\'));

return appPath == dataPath;
}

private void OpenDataFolder_Click(object sender, RoutedEventArgs e)
{
Process.Start(_basePath);
}
}
}

0 comments on commit cbbc0be

Please sign in to comment.