I ported my PHP script for downloading Youtube videos to a C# plugin (can't stand C++). It works beautifully but I was thinking of adding some return parameters to it such as Status, Progress, File Size and Downloaded Size, and that is where I hit a road block and it has been over 10hrs and I have found nothing helpful.
C# Portion
Code: Select all
public UInt32 Update(Rainmeter.Settings.InstanceSettings instance) {
switch (instance.INI_Value("FieldType").ToUpper()) {
case "PROGRESS":
return Convert.ToUInt32(instance.GetTempValue("LastProgress", 0));
case "FILESIZE":
return Convert.ToUInt32(instance.GetTempValue("LastFileSize", 0));
case "DOWNLOADSIZE":
return Convert.ToUInt32(instance.GetTempValue("LastDownloadSize", 0));
case "BUSY":
return Convert.ToUInt32(instance.GetTempValue("LastBusy", 0));
}
return 0;
}
public double Update2(Rainmeter.Settings.InstanceSettings instance) {
return 0.0;
}
public string GetString(Rainmeter.Settings.InstanceSettings instance) {
switch (instance.INI_Value("FieldType").ToUpper()) {
case "PROGRESS":
return instance.GetTempValue("LastProgress", 0).ToString();
case "FILESIZE":
return instance.GetTempValue("LastFileSize", 0).ToString();
case "DOWNLOADSIZE":
return instance.GetTempValue("LastDownloadSize", 0).ToString();
case "BUSY":
return instance.GetTempValue("LastBusy", 0).ToString();
}
return instance.GetTempValue("LastStatus", "Ready").ToString();
}
Code: Select all
[YTDownloader]
Measure=Plugin
Plugin=Plugins\YoutubeDownloader.dll
SaveTo=#SaveTo#
[YT.Status.Text]
Meter=STRING
MeasureName=YTDownloader
X=385
Y=40
FontColor=255, 255, 255, 60
FontSize=9
FontFace=Segoe UI Semibold
AntiAlias=1
AutoScale=1
StringAlign=Right
StringEffect=Shadow
FontEffectColor=0,0,0,40
[YT.Progress]
Measure=Plugin
Plugin=Plugins\YoutubeDownloader.dll
FieldType="Progress"
[YT.Progress.Text]
Meter=STRING
MeasureName=YT.Progress
X=385
Y=80
FontColor=255, 255, 255, 60
FontSize=9
FontFace=Segoe UI Semibold
AntiAlias=1
AutoScale=1
StringAlign=Right
StringEffect=Shadow
FontEffectColor=0,0,0,40
Prefix="Progress: "
The problem is that I can't get YT.Progress.Text to show anything but "0".
I would be grateful if anyone with any hints could pitch in.