ActionTimer plugin ActionTimerプラグイン

Plugin=ActionTimer

Executes a series of Rainmeter actions independent of the normal skin Update cycle. This can allow the series of actions to be executed faster (or slower) than the rate defined in Update in [Rainmeter] and can be executed as fast as 1 millisecond apart.通常のスキン更新サイクルとは無関係に一連のRainmeterアクションを実行します。これにより、一連のアクションを[Rainmeter]のUpdateで定義されているレートよりも速く(または遅く)実行でき、1ミリ秒間隔で実行できます。

Overview概要

To understand the purpose of ActionTimer, it helps to have some understanding of how Rainmeter runs a skin. On each skin Update, the value set in the [Rainmeter] section of the skin, Rainmeter does the following:ActionTimerの目的を理解するには、Rainmeterがどのようにスキンを実行するのかをある程度理解しておくと役立ちます。更新するたびに、スキンの[Rainmeter]セクションに設定された値に従って、Rainmeterは次の処理を行います。

  • Update all measuresすべての対策を更新する
  • Execute measure actions対策アクションを実行する
  • Update all metersすべてのメーターを更新する
  • Redraw the skinスキンを描き直す

Update has a lower limit of 16, or once every 16 milliseconds. This means that any series of separate actions can only execute every 16 milliseconds. In addition, setting a very low Update rate in [Rainmeter] can cause the entire skin to use a lot of CPU resources, when you may only need it to be "fast" for a specific purpose, perhaps some animation or transition effect. Finally, any series of actions you take in the context of the Update cycle are "blocking", in the sense that Rainmeter must complete them before it is able to continue with other normal skin processing.更新の下限は16、つまり16ミリ秒に1回です。つまり、一連の個別のアクションは16ミリ秒ごとにしか実行できません。さらに、[Rainmeter]で更新レートを非常に低い値に設定すると、特定の目的のために "高速"にする必要があるだけの場合、スキン全体で多くのCPUリソースを使用する可能性があります。最後に、Rainmeterが他の通常のスキン処理を続けることができる前にそれらを完了しなければならないという意味で、Updateサイクルの文脈であなたが取るどんな一連の行動も「ブロックしている」。

While you can "stack up" actions in a single action option:あなたは、単一のアクションオプションでアクションを「積み上げる」ことができますが:

IfTrueAction=[!SetOption SomeMeter X "5"][!SetOption SomeMeter X "10"]

Rainmeter will run both of the actions in the same Update cycle, before it updates the meters and redraws the skin, and so in effect they both visibly happen "at once". The meter won't visibly move to "5" and then "10", but will just jump straight to "10". The only current solution is to have the two actions take place in two Update cycles, and thus the fastest the series can ever execute is every 16 milliseconds.Rainmeterは、メーターを更新してスキンを再描画する前に、同じUpdateサイクルで両方のアクションを実行します。そのため、事実上、両方のアクションが「同時に」発生します。メーターは目に見えて「5」に移動してから「10」に移動するのではなく、単に「10」に直接ジャンプします。現在の唯一の解決策は、2つの更新サイクルで2つのアクションを実行することです。したがって、シリーズが実行できる最も速いのは16ミリ秒ごとです。

Now 16 milliseconds seems pretty fast, and it is. However, if you have some animation with 100 "frames" or want to do some "transition" of a meter; fading the opacity, shifting the color or sliding the position, it is in fact visibly quite slow.今16ミリ秒はかなり速いようです、そしてそれはそうです。ただし、100の「フレーム」を含むアニメーションがある場合、またはメーターの「トランジション」を行いたい場合は、不透明度を薄める、色を変える、または位置をスライドさせると、実際にはかなり遅くなります。

Don't forget as well, that that 16 millisecond lower limit is the time Rainmeter will have to do everything in the skin. Update all measures, take all actions, update all meters, and redraw the skin. In reality, even a moderately complicated skin isn't really going to update every 16 milliseconds in any case, it will at best "try to".その16ミリ秒の下限が、Rainmeterがスキンの中ですべてのことをしなければならない時間であることも忘れないでください。すべての測定を更新し、すべてのアクションを実行し、すべてのメーターを更新し、そしてスキンを再描画します。実際には、適度に複雑なスキンであっても16ミリ秒ごとに実際に更新されるわけではなく、せいぜい「しよう」となるでしょう。

What ActionTimer does is execute the list of actions defined in ActionListN, one after the other, in a separate thread outside the normal Update cycle, as fast as it possibly can. This is REALLY fast. The Wait N values that you put in between each action in the list is what stops them from appearing to just happen all at once, and allows you to completely control the speed of the series of actions. Wait can be any number, from 1 (one millisecond) to whatever you need.ActionTimerが行うことは、可能な限り速く、通常のUpdateサイクルの外側の別のスレッドで、ActionList Nに定義されているアクションのリストを次々に実行することです。これは本当に速いです。待機Nのリスト内の各アクションの間に置く値は、ちょうどすべてを一度に起こるように見えるからそれらを停止し、あなたが完全に一連のアクションの速度を制御することを可能にするものです。1(1ミリ秒)から必要なものまで、待ち時間はいくつでもかまいません。

Since the actions in ActionListN are executed in a separate thread from the main Rainmeter process, the skin will carry on updating normally, while the ActionTimer plugin will control the actions in the list.ActionList NのアクションはメインのRainmeterプロセスとは別のスレッドで実行されるので、スキンは通常通り更新を続けますが、ActionTimerプラグインはリスト内のアクションを制御します。

Important Note重要な注意点

While ActionTimer is very CPU efficient, it is not "free". The actions are executed by the plugin in a separate thread from the rest of the Rainmeter skin, allowing the skin to continue to process normally while the plugin actions are executing, with the plugin communicating with the skin via window "messages" to the Rainmeter message queue. This allows the plugin to instruct the skin to "do this now", much as a MouseOverAction is recognized and acted upon immediately.ActionTimerは非常にCPU効率が高いですが、「無料」ではありません。アクションは、Rainmeterスキンの他の部分とは別のスレッドでプラグインによって実行され、プラグインアクションが実行されている間、スキンは通常どおり処理を続行できます。キュー。これにより、MouseOverActionが認識されてすぐに処理されるように、プラグインはスキンに「今すぐこれを実行する」ように指示できます。

Some care must be taken however, not to overwhelm the message queue. Things done with ActionTimer in general should be short targeted actions, like a meter transition or short animation. Ensure that there is at least some "wait" time between actions, so Rainmeter has time to handle other messages in the message queue. In addition, keep in mind that !Redraw actions can be relatively CPU expensive, particularly if a lot of image resizing is involved.ただし、メッセージキューをあふれさせないように注意する必要があります。一般的にActionTimerで行われることは、メーターの移動や短いアニメーションのような、短いターゲットアクションです。アクション間に少なくとも「待機」時間があることを確認してください。そうすれば、Rainmeterはメッセージキュー内の他のメッセージを処理する時間があります。さらに!Redraw、特に大量の画像サイズ変更が含まれる場合、アクションは比較的CPUに負荷がかかる可能性があることに留意してください。

ActionTimer does not support, and should not be used, to do anything "endless" or otherwise of a very long duration combined with a very rapid update. If the Rainmeter message queue becomes overwhelmed, the skin can get laggy and unresponsive to mouse actions you might take.ActionTimerは、「無限」またはその他の非常に長い期間の更新をサポートするものではないため、使用するべきではありません。Rainmeterメッセージキューがあふれていると、スキンが遅れてマウスの動作に反応しなくなる可能性があります。

Optionsオプション

General measure options一般的な測定オプション

All general measure options are valid.一般的な測定オプションはすべて有効です。

ActionList1, ActionList2 .. ActionListN

A numbered option, starting with ActionList1.ActionList1から始まる番号付きオプション。

Each ActionListN will execute one or more Actions separated by the pipe | character. In addition there are two list commands, Repeat and Wait, that can be used in the ActionList. In a sense, this option is a "script" of what you want the plugin to do when the ActionList is triggered. In its most simple expression, it is各ActionList NActions、パイプ|文字で区切られた1つ以上を実行します。さらに、ActionListで使用できる2つのリストコマンド、RepeatとWaitがあります。ある意味では、このオプションは、ActionListがトリガーされたときにプラグインに実行させたいことの「スクリプト」です。その最も単純な表現では、

ActionList1=Do this | Wait this long | Do that

ActionList componentsActionListコンポーネント

  • Action name
    The plugin will execute what is defined in the named Action option. The action name can be anything. This is simply the name of the Action option, and should never be actual bangs or commands itself. The actual skin bangs or commands to be executed are defined in the Action option.アクション名
    プラグインは、指定されたアクションオプションで定義されている内容を実行します。アクション名は何でもかまいません。これは単なるActionオプションの名前であり、決して実際の強打やコマンドそのものであるべきではありません。実際に実行されるスキンの動作音やコマンドは、Actionオプションで定義されています。
  • Repeat Action name, Wait time number, Repeat count number
    This will repeat the named Action option Repeat count times, with a wait of Wait time milliseconds between each. Note that Wait time is not applied after the last execution of Action name, only between each.繰り返し アクション名待機時間番号繰り返しカウント数
    これは、指定されたアクションオプション繰り返しカウント回数を繰り返します待機時間はそれぞれミリ秒待機します。注待機時間は、最後に実行した後に適用されていないアクション名のみそれぞれの間に、。
  • Wait number of milliseconds
    This is used to create a pause or wait in milliseconds between each named Action or other component in the ActionList. There should always be a Wait of at least 1 millisecond between each ActionList component. ミリ秒の待機
    これは、指定された各アクションまたはActionList内の他のコンポーネントの間に一時停止または待機をミリ秒単位で作成するために使用されます。各ActionListコンポーネント間には、常に少なくとも1ミリ秒のWaitが必要です。
  • The pipe | character is used to separate each of the ActionList components.パイプ|文字は、各ActionListコンポーネントを区切るために使用されます。

Examples:例:

ActionList1=FirstAction | Wait 5 | SecondAction
Execute everything defined in the FirstAction option, wait 5 milliseconds, and execute everything defined in the SecondAction option.ActionList1=FirstAction | Wait 5 | SecondAction
で定義されたすべての実行FirstActionのオプションを、5ミリ秒待機し、で定義されたすべての実行SecondActionのオプションを選択します。

ActionList1=Repeat FirstAction, 5, 20 | Wait 5 | SecondAction
Execute everything defined in the FirstAction option 20 times, with a wait of 5 milliseconds between each execution of FirstAction. Wait 5 milliseconds, and execute everything defined in the SecondAction option.ActionList1=Repeat FirstAction, 5, 20 | Wait 5 | SecondAction
FirstActionの各実行間に5ミリ秒の待機時間を設けて、FirstActionオプションで定義されたすべてのものを20回実行します。5ミリ秒待ってから、SecondActionオプションに定義されているすべてのものを実行します。

Action Any unique name=[!bang or command]

These can be any unique name, in any order. They will contain the skin bangs or other actions that will be executed by the plugin when the named action is called by an ActionList.これらは任意の順序で、任意の一意の名前にすることができます。これらは、指定されたアクションがActionListによって呼び出されたときにプラグインによって実行されるスキンの前髪やその他のアクションを含みます。

They are defined and executed exactly the same as any other Action option in Rainmeter, for instance LeftMouseUpAction or OnChangeAction.彼らは、定義され、他のとまったく同じに実行されるアクションのオプション例えば、RainmeterでLeftMouseUpActionOnChangeAction

Examples:例:

[MeasureChangeFont]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SetFontSmall | Wait 1000 | SetFontBig
SetFontSmall=[!SetOption SomeMeter FontSize "10"][!UpdateMeter SomeMeter][!Redraw]
SetFontBig=[!SetOption SomeMeter FontSize "15"][!UpdateMeter SomeMeter][!Redraw]

Notes:ノート:

  • Since the actions are being done independent of the Update cycle of the skin, you must explicitly do any !UpdateMeter and !Redraw commands needed to have the skin actually reflect any changes to meters made in the action.アクションはUpdateスキンのサイクルとは無関係に行われているので、アクションに加えられたメーターに対する変更を実際にスキンに反映させるために必要なany !UpdateMeterおよび!Redrawコマンドを明示的に実行する必要があります。
  • If you are using !SetVariable to change and use any dynamic #Variables# in the action, you will need to !UpdateMeasure the plugin measure between each execution of the action option, to ensure the measure has the most current value for the #Variable#.使用している場合は!SetVariable変更して、アクションに任意のダイナミック#変数#を使用するには、する必要があります!UpdateMeasure尺度は#変数#の最新の値を持っていることを確認するために、アクションオプションの各実行の間にプラグインの措置。

This can be simplified by setting and using a #Variable# that will take the appropriate update actions, and then just execute that #Variable# at the end of each action option.これは、適切な更新アクションを実行する#変数#を設定して使用し、その後各アクションオプションの最後にその#変数#を実行するだけで簡単にできます。

[Variables]
U=[!UpdateMeasure MeasureChangeFont][!UpdateMeter *][!Redraw]

[MeasureChangeFont]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SetFontSmall | Wait 1000 | SetFontBig
SetFontSmall=[!SetOption SomeMeter FontSize "10"]#U#
SetFontBig=[!SetOption SomeMeter FontSize "15"]#U#
IgnoreWarnings Default: 0IgnoreWarnings デフォルト: 0

Any ActionListN must completely finish all actions in the list before it can be executed again. Any command to execute the list while it is still performing actions will be ignored, and a warning message will be generated in the log. There may be occasions where this is in fact desired behavior, and the log error messages can be suppressed.

  • 0 - Warnings in the log are produced. (default)0 - ログ内の警告が生成されます。(デフォルト)
  • 1 - Warnings in the log are suppressed.1 - ログ内の警告は抑制されます。

Plugin Commandsプラグインコマンド

The plugin will take no action unless triggered with one of these commands.

Execute ActionList number

Execute the correspondingly numbered ActionListN.対応する番号を付けて実行します。ActionListN

Example:例:

LeftMouseUpAction=[!CommandMeasure MeasureName "Execute 1"]

Stop ActionList number

Stop the correspondingly numbered ActionListN.対応する番号を付けて停止します。ActionListN

As noted above, Any ActionListN must completely finish all actions in the list before it can be executed again. Any command to execute the list while it is still performing actions will be ignored, and a warning message will be generated in the log.上記のように、Any ActionList Nは、リスト内のすべてのアクションを完全に終了させて??から実行する必要があります。まだアクションを実行している間にリストを実行するコマンドはすべて無視され、ログに警告メッセージが生成されます。

The Stop N command will immediately terminate and reset the corresponding running ActionListN, so it may be executed again.

Example:例:

LeftMouseUpAction=[!CommandMeasure SomeMeasure "Stop 1"][!CommandMeasure SomeMeasure "Execute 1"]

Examples

Several example skins are included in the .rmskin download. Take a look at the code to see some different ways you might use the plugin.いくつかのサンプルスキンが.rmskinダウンロードに含まれています。あなたがプラグインを使用するかもしれないいくつかの異なる方法を見るためにコードを見てください。

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
W=15
U=[!UpdateMeasureGroup Sizers][!UpdateMeter MeterText][!Redraw]
Size=8

[MeasureSizeUp]
Measure=Plugin
Plugin=ActionTimer
Group=Sizers
ActionList1=ChangeSizeStart|Wait #W#|Repeat ChangeSizeCalc,#W#,11
ChangeSizeStart=[!SetVariable Size "#Size#"]#U#
ChangeSizeCalc=[!SetVariable Size "(Clamp(#Size#+5,8,60))"]#U#
IfCondition=#Size# = 8
IfTrueAction=[!SetOption MeterText Text "small"]#U#
IfCondition2=(#Size# > 8) && (#Size# < 60)
IfTrueAction2=[!SetOption MeterText Text "Changing"]#U#
IfCondition3=#Size# = 60
IfTrueAction3=[!SetOption MeterText Text "BIG"]#U#
DynamicVariables=1

[MeasureSizeDown]
Measure=Plugin
Plugin=ActionTimer
Group=Sizers
ActionList1=ChangeSizeStart|Wait #W#|Repeat ChangeSizeCalc,#W#,11
ChangeSizeStart=[!SetVariable Size "#Size#"]#U#
ChangeSizeCalc=[!SetVariable Size "(Clamp(#Size#-5,8,60))"]#U#
IfCondition=#Size# = 8
IfTrueAction=[!SetOption MeterText Text "small"]#U#
IfCondition2=(#Size# > 8) && (#Size# < 60)
IfTrueAction2=[!SetOption MeterText Text "Changing"]#U#
IfCondition3=#Size# = 60
IfTrueAction3=[!SetOption MeterText Text "BIG"]#U#
DynamicVariables=1

[MeterText]
Meter=String
W=400
H=90
X=200
Y=45
StringAlign=CenterCenter
FontSize=#Size#
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=Small
UpdateDivider=-1
DynamicVariables=1
MouseOverAction=[!CommandMeasure MeasureSizeDown "Stop 1"][!CommandMeasure MeasureSizeUp "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSizeUp "Stop 1"][!CommandMeasure MeasureSizeDown "Execute 1"]

関連記事

スポンサーリンク

多言語対応テキストエディタの一覧

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る