Skip to content

Commit

Permalink
Merge pull request #27 from rocksdanister/dev-build
Browse files Browse the repository at this point in the history
### What’s new:
•	Don’t forget to checkout Lively’s reddit page for more animated Wallpapers: https://www.reddit.com/r/LivelyWallpaper/
•	New Performance setting: Pause wallpaper when on battery power (Laptops/UPS.)
(Web wallpapers will look blank when paused, this is a known limitation that will be addressed in future update.)
•	Span wallpaper playback behavior change: 
1.	Only Pause Wallpaper if foreground application is stretched across all displays when “Per Display” display rule is selected under Performance settings.
2.	Pause wallpaper if foreground application is maximized in any monitor when “All Display(s)” is selected.

•	(Web) New dropdown control for web interaction, “Folder Dropdown”
Automatically populates the dropdown menu based on the folder contents.
Learn more: https://github.com/rocksdanister/lively/wiki/Web-Guide-IV-:-Interaction
•	(Web) “Restore to Default” option for customisable wallpapers, restores wallpaper properties to original value (Existing wallpapers from pre v0.9 will restore to last saved value)
•	(Web) ColorDialog default color will be previously selected color.
•	Turned off Deferred Scrolling for Library list (wallpaper tile preview as you scroll.)
•	Some UI changes/tweaks.
### Fixes:
•	(Web) Fixed several issues with customisable web wallpapers on multiple monitor systems: #23
•	Wallpaper file checking is skipped during library loading in-order to stop disk power-on/activity each time lively is launched from tray (when wallpapers is on separate drive.)
•	Windows 7 wallpaper disappearing fix (still not officially supported by me, just update your system people *_*)
### Important Notice:
•	Auto update might fail due to smartscreen filter, the setup is downloaded to “Documents/Lively Wallpaper/tmpdata/update.exe”
### Known Issues:
•	Screensaver might get disabled when using default video players, as a temporary fix:
“Open Windows media player rightclick empty area top - > Tools - > Options and then select Allow screen saver during playback.” or use DirectShow videoplayer.
•	Automatic Library Import is currently disabled for “Duplicate” wallpaper mode.
•	Video stutter with default video players in some systems, as a temporary fix use mpv.
•	Scrollbar might appear in web wallpaper after adding to library, as a temporary fix restart wallpaper.
•	(old) Image resize in wallpaper creator is not multithreaded yet, UI will not respond temporarily for large images (“Export Lively .zip” is the recommend method.)
  • Loading branch information
rocksdanister authored Mar 15, 2020
2 parents 8ab700f + acc46cc commit 6278d81
Show file tree
Hide file tree
Showing 24 changed files with 728 additions and 261 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ Help translate lively to other languages: <a href="https://github.com/rocksdanis

**_I'm not officially affiliated with Unity technologies, godot, shadertoy;_**
## Download
##### Latest version: v0.8.5.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.8.5.0)
##### Latest version: v0.9.0.0 (Windows 10, 8.1)[What's new?](https://github.com/rocksdanister/lively/releases/tag/v0.9.0.0)
- [`Download Lively Installer`][direct-full-win32]
_102MB, Web wallpaper support & some sample wallpapers included._
- [`Download Lively Portable`][direct-full-portable-win32]
_111MB, (No Installation) Web wallpaper support & some sample wallpapers included._

**Portable build: Latest Visual C++ Redistributable is required: [vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe)**

[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.5.0/lively_setup_x86_full_v0850.exe
[direct-full-win32]: https://github.com/rocksdanister/lively/releases/download/v0.9.0.0/lively_setup_x86_full_v0900.exe

[direct-full-portable-win32]: https://github.com/rocksdanister/lively/releases/download/v0.8.5.0/lively_portable_x86_full_v0850.zip
[direct-full-portable-win32]: https://github.com/rocksdanister/lively/releases/download/v0.9.0.0/lively_portable_x86_full_v0900.zip

**Installer will give Smartscreen warning, [discussion.](https://github.com/rocksdanister/lively/issues/9)**

Expand Down
2 changes: 1 addition & 1 deletion src/lively setup/Inno.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Lively Wallpaper"
#define MyAppVersion "0.8.5.0"
#define MyAppVersion "0.9.0.0"
#define MyAppPublisher "rocksdanister"
#define MyAppURL "https://github.com/rocksdanister/lively"
#define MyAppExeName "livelywpf.exe"
Expand Down
1 change: 1 addition & 0 deletions src/livelywpf/livelywpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected override void OnStartup(StartupEventArgs e)
//create directories if not exist
Directory.CreateDirectory(Path.Combine(PathData, "SaveData"));
Directory.CreateDirectory(Path.Combine(PathData, "SaveData", "wptmp"));
Directory.CreateDirectory(Path.Combine(PathData, "SaveData", "wpdata"));
Directory.CreateDirectory(Path.Combine(PathData, "wallpapers"));
Directory.CreateDirectory(Path.Combine(PathData, "tmpdata"));
Directory.CreateDirectory(Path.Combine(PathData, "tmpdata", "wpdata"));
Expand Down
115 changes: 74 additions & 41 deletions src/livelywpf/livelywpf/MainWindow.xaml

Large diffs are not rendered by default.

134 changes: 95 additions & 39 deletions src/livelywpf/livelywpf/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using System.Diagnostics;

using System.Reflection;
using Ionic.Zip;
//using System.IO.Compression;
using System.Windows.Forms;
using System.IO;
using Microsoft.Win32;
Expand All @@ -29,16 +23,13 @@
using Octokit;
using FileMode = System.IO.FileMode;
using Microsoft.WindowsAPICodePack.Shell;
using IWshRuntimeLibrary;
using System.Threading;
using File = System.IO.File;
using NLog;
using System.Collections.ObjectModel;
using System.Windows.Media.Animation;
using System.ComponentModel;

using static livelywpf.SaveData;
using System.Text.RegularExpressions;
using System.Windows.Interop;
using SaveFileDialog = Microsoft.Win32.SaveFileDialog;
using System.Globalization;
Expand Down Expand Up @@ -675,15 +666,27 @@ public void UpdateWallpaperLibrary()

}

if (File.Exists(SaveData.info.FileName) || info.IsAbsolutePath //load anyway for absolutepath, setupwallpaper will check if file exists for this type and give warning.
|| info.Type == SetupDesktop.WallpaperType.video_stream || info.Type == SetupDesktop.WallpaperType.url)
//load anyway for absolutepath, setupwallpaper will check if file exists for this type and give warning.
//this also prevents disk powerup in the event the files are in different hdd thats sleeping and lively is launched from tray.
if (info.IsAbsolutePath)
{
Logger.Info("Loading Wallpaper (absolute path):- " + SaveData.info.FileName + " " + SaveData.info.Type);
tmpLoadedWallpapers.Add(new TileData(info, item));
}
else if(info.Type == SetupDesktop.WallpaperType.video_stream
|| info.Type == SetupDesktop.WallpaperType.url) //no files for this type.)
{
Logger.Info("Loading Wallpaper:- " + SaveData.info.FileName + " " + SaveData.info.Type);
Logger.Info("Loading Wallpaper (url/stream):- " + SaveData.info.FileName + " " + SaveData.info.Type);
tmpLoadedWallpapers.Add(new TileData(info, item));
}
else if (File.Exists(SaveData.info.FileName))
{
Logger.Info("Loading Wallpaper (wp dir):- " + SaveData.info.FileName + " " + SaveData.info.Type);
tmpLoadedWallpapers.Add(new TileData(info, item));
}
else
{
Logger.Info("Files does not exist, skipping wallpaper:- " + SaveData.info.FileName + " " + SaveData.info.Type);
Logger.Info("Skipping wallpaper:- " + SaveData.info.FileName + " " + SaveData.info.Type);
}
}
}
Expand Down Expand Up @@ -1020,20 +1023,10 @@ private async void SetWallpaperBtn_Click(object sender, RoutedEventArgs e)
else if (ch == MessageDialogResult.Affirmative)
{}
}
/*
int i = 0;
if ((i = SetupDesktop.wallpapers.FindIndex(x => x.FilePath.Equals(selection.LivelyInfo.FileName, StringComparison.Ordinal))) != -1)
{
if(selection.IsCustomisable)//File.Exists(Path.Combine(Path.GetDirectoryName(selection.LivelyInfo.FileName), "LivelyProperties.json")))
{
SetupDesktop.SendCustomiseMsgtoWallpaper(SetupDesktop.wallpapers[i].DeviceName);
//ShowCustomiseWidget(SetupDesktop.wallpapers[i].DeviceName);
return;
}
}
*/

if (selection.IsCustomisable)
{
//show customise btn when wp set.
selection.CustomiseBtnToggle = true;
}

Expand All @@ -1045,6 +1038,11 @@ private async void SetWallpaperBtn_Click(object sender, RoutedEventArgs e)
SetupWallpaper(selection.LivelyInfo.FileName, selection.LivelyInfo.Type, null, true);
}

/// <summary>
/// Library wp customise btn.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuItem_CustomiseWallpaper_Click(object sender, RoutedEventArgs e) //contextmenu
{
//ShowCustomiseWidget();
Expand All @@ -1054,13 +1052,39 @@ private void MenuItem_CustomiseWallpaper_Click(object sender, RoutedEventArgs e)
if (Multiscreen)
{
var selection = (TileData)wallpapersLV.SelectedItem;
SetupDesktop.SendCustomiseMsgtoWallpaper2(selection.LivelyInfo.FileName);

//checking if same wp running more than 1 instance.
var wp = SetupDesktop.webProcesses.FindAll(x => x.FilePath.Equals(selection.LivelyInfo.FileName, StringComparison.Ordinal));
if (wp.Count > 1)
{
//monitor select dialog
DisplaySelectWindow displaySelectWindow = new DisplaySelectWindow
{
WindowStartupLocation = WindowStartupLocation.CenterScreen
};
displaySelectWindow.ShowDialog();

if (DisplaySelectWindow.selectedDisplay == null) //none
{
return;
}
SetupDesktop.SendCustomiseMsgtoWallpaper(DisplaySelectWindow.selectedDisplay);
}
else
{
SetupDesktop.SendCustomiseMsgtoWallpaper2(selection.LivelyInfo.FileName);
}
}
else
{
SetupDesktop.SendCustomiseMsgtoWallpaper(Screen.PrimaryScreen.DeviceName);
}
}

/// <summary>
/// System tray customise option.
/// Always display selection dialog for multiple screens.
/// </summary>
private static void ShowCustomiseWidget()
{
if (Multiscreen)
Expand Down Expand Up @@ -1565,7 +1589,7 @@ public static void SwitchTrayIcon(bool isPaused)
try
{
//don't make much sense with per-display rule in multiple display systems, so turning off.
if (!Multiscreen && !_isExit)
if ( (!Multiscreen || SaveData.config.WallpaperArrangement == WallpaperArrangement.span) && !_isExit)
{
if (isPaused)
{
Expand Down Expand Up @@ -1607,6 +1631,7 @@ private void MainWindow_Closing(object sender, System.ComponentModel.CancelEvent
}
else
{
//static event, otherwise memory leak.
SystemEvents.DisplaySettingsChanged -= SystemEvents_DisplaySettingsChanged;

SaveData.config.SafeShutdown = true;
Expand Down Expand Up @@ -2580,6 +2605,13 @@ private void SubcribeUI()
TileGenerateToggle.IsCheckedChanged += TileGenerateToggle_IsCheckedChanged;
comboBoxVideoPlayerScaling.SelectionChanged += ComboBoxVideoPlayerScaling_SelectionChanged;
comboBoxGIFPlayerScaling.SelectionChanged += ComboBoxGIFPlayerScaling_SelectionChanged;
comboBoxBatteryPerf.SelectionChanged += ComboBoxBatteryPerf_SelectionChanged;
}

private void ComboBoxBatteryPerf_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SaveData.config.BatteryPause = (SaveData.AppRulesEnum)comboBoxBatteryPerf.SelectedIndex;
SaveData.SaveConfig();
}

private void ComboBoxGIFPlayerScaling_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand All @@ -2590,8 +2622,10 @@ private void ComboBoxGIFPlayerScaling_SelectionChanged(object sender, SelectionC
var result = SetupDesktop.wallpapers.FindAll(x => x.Type == SetupDesktop.WallpaperType.gif);
SetupDesktop.CloseAllWallpapers(SetupDesktop.WallpaperType.gif);

if (result != null)
if (result.Count != 0)
{
RestoreWallpaper(result);
}
}

private void ComboBoxVideoPlayerScaling_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand All @@ -2602,8 +2636,10 @@ private void ComboBoxVideoPlayerScaling_SelectionChanged(object sender, Selectio
var videoWp = SetupDesktop.wallpapers.FindAll(x => x.Type == SetupDesktop.WallpaperType.video); //youtube is started as apptype, not included!
SetupDesktop.CloseAllWallpapers(SetupDesktop.WallpaperType.video);

if (videoWp != null)
if (videoWp.Count != 0)
{
RestoreWallpaper(videoWp);
}
}

private void TileGenerateToggle_IsCheckedChanged(object sender, EventArgs e)
Expand All @@ -2630,7 +2666,7 @@ private void CmbBoxStreamQuality_SelectionChanged(object sender, SelectionChange
var streamWP = SetupDesktop.wallpapers.FindAll(x => x.Type == SetupDesktop.WallpaperType.video_stream);
SetupDesktop.CloseAllWallpapers(SetupDesktop.WallpaperType.video_stream);

if (streamWP != null)
if (streamWP.Count != 0)
{
RestoreWallpaper(streamWP);
}
Expand Down Expand Up @@ -2667,6 +2703,7 @@ private void RestoreMenuSettings()
lblPortableTxt.Visibility = Visibility.Collapsed;
}


if (SaveData.config.AppTransparency)
{
if (SaveData.config.AppTransparencyPercent >= 0.5 && SaveData.config.AppTransparencyPercent <= 0.9)
Expand Down Expand Up @@ -2710,6 +2747,17 @@ private void RestoreMenuSettings()
comboBoxGIFPlayerScaling.SelectedIndex = (int)SaveData.config.GifScaler;
}

try
{
comboBoxBatteryPerf.SelectedIndex = (int)SaveData.config.BatteryPause;
}
catch (ArgumentOutOfRangeException)
{
SaveData.config.BatteryPause = AppRulesEnum.ignore;
SaveData.SaveConfig();
comboBoxBatteryPerf.SelectedIndex = (int)SaveData.config.BatteryPause;
}

try
{
comboBoxVideoPlayerScaling.SelectedIndex = (int)SaveData.config.VideoScaler;
Expand Down Expand Up @@ -3058,8 +3106,10 @@ private void ComboBoxVideoPlayer_SelectionChanged(object sender, SelectionChange
var videoWp = SetupDesktop.wallpapers.FindAll(x => x.Type == SetupDesktop.WallpaperType.video); //youtube is started as apptype, not included!
SetupDesktop.CloseAllWallpapers(SetupDesktop.WallpaperType.video);

if (videoWp != null)
if (videoWp.Count != 0)
{
RestoreWallpaper(videoWp);
}
}

/// <summary>
Expand All @@ -3075,16 +3125,19 @@ private void ComboBoxGIFPlayer_SelectionChanged(object sender, SelectionChangedE
var result = SetupDesktop.wallpapers.FindAll(x => x.Type == SetupDesktop.WallpaperType.gif);
SetupDesktop.CloseAllWallpapers(SetupDesktop.WallpaperType.gif);

//no gif wp's currently running to restore; ignore.
if (result == null)
return;
else
if (result.Count != 0)
{
RestoreWallpaper(result);
}
}

private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
Process.Start(e.Uri.AbsoluteUri);
try
{
Process.Start(e.Uri.AbsoluteUri);
}
catch { } //if no default mail client, win7 error.
}

private void Hyperlink_SupportPage(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -3257,11 +3310,14 @@ private static string YoutubeDLArgGenerate(string link)
return "\"" + link + "\"" + " --force-window=yes --loop-file --keep-open --hwdec=yes" + quality;
}

public readonly static string[] formatsVideo = { ".dat", ".wmv", ".3g2", ".3gp", ".3gp2", ".3gpp", ".amv", ".asf", ".avi", ".bin", ".cue", ".divx", ".dv", ".flv", ".gxf", ".iso", ".m1v", ".m2v", ".m2t", ".m2ts", ".m4v",
".mkv", ".mov", ".mp2", ".mp2v", ".mp4", ".mp4v", ".mpa", ".mpe", ".mpeg", ".mpeg1", ".mpeg2", ".mpeg4", ".mpg", ".mpv2", ".mts", ".nsv", ".nuv", ".ogg", ".ogm", ".ogv", ".ogx", ".ps", ".rec", ".rm",
".rmvb", ".tod", ".ts", ".tts", ".vob", ".vro", ".webm" };
// public readonly static string[] formatsVideo = { ".dat", ".wmv", ".3g2", ".3gp", ".3gp2", ".3gpp", ".amv", ".asf", ".avi", ".bin", ".cue", ".divx", ".dv", ".flv", ".gxf", ".iso", ".m1v", ".m2v", ".m2t", ".m2ts", ".m4v",
// ".mkv", ".mov", ".mp2", ".mp2v", ".mp4", ".mp4v", ".mpa", ".mpe", ".mpeg", ".mpeg1", ".mpeg2", ".mpeg4", ".mpg", ".mpv2", ".mts", ".nsv", ".nuv", ".ogg", ".ogm", ".ogv", ".ogx", ".ps", ".rec", ".rm",
// ".rmvb", ".tod", ".ts", ".tts", ".vob", ".vro", ".webm" };
static bool IsVideoFile(string path)
{
string[] formatsVideo = { ".dat", ".wmv", ".3g2", ".3gp", ".3gp2", ".3gpp", ".amv", ".asf", ".avi", ".bin", ".cue", ".divx", ".dv", ".flv", ".gxf", ".iso", ".m1v", ".m2v", ".m2t", ".m2ts", ".m4v",
".mkv", ".mov", ".mp2", ".mp2v", ".mp4", ".mp4v", ".mpa", ".mpe", ".mpeg", ".mpeg1", ".mpeg2", ".mpeg4", ".mpg", ".mpv2", ".mts", ".nsv", ".nuv", ".ogg", ".ogm", ".ogv", ".ogx", ".ps", ".rec", ".rm",
".rmvb", ".tod", ".ts", ".tts", ".vob", ".vro", ".webm" };
if (formatsVideo.Contains(Path.GetExtension(path), StringComparer.OrdinalIgnoreCase))
{
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/livelywpf/livelywpf/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.5.0")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit 6278d81

Please sign in to comment.