Menu

Paddy_Developer_Wiki

Dorfl68

Running Paddy from Source Code

Paddy Directory Structure

  1. Module directory: C:\Users\[user name]\AppData\Roaming\Adobe\Lightroom\Modules\Paddy.lrdevplugin
    Holds the Lightroom plugin .LUA files.
    There are many small files here because LUA sucks. All this does is install a menu in LR and start Paddy
    1. Executable directory

C:\Users\[user name]\AppData\Roaming\Adobe\Lightroom\Modules\Paddy.lrdevplugin\Paddy Holds all Paddy.exe files, DLLs, manifests, and a few .ini files for debuging

      1. Resource directory

C:\Users\[user name]\AppData\Roaming\Adobe\Lightroom\Modules\Paddy.lrdevplugin\Paddy\resources All files that Paddy needs for its user interface, like pictures, the language files, and icons

      1. Template directory

C:\Users\[user name]\AppData\Roaming\Adobe\Lightroom\Modules\Paddy.lrdevplugin\Paddy\templates Various device templates. This is not maintained any more, as templates will move to an online repository

Key Paddy files

.Exe

.DLL

.ini

Setting up your development environment

Software you will need

AHK_L

Paddy special AHK_L

Paddy compilation scripts

gorc.exe

Freeware

Reshacker

Freeware

Debugview

Freeware

Midi

OSC

Basics

OSC stands for Open Sound Control, and is basically the next generation of Midi. It is a network protocol that is pretty open. It originally was designed to be very flexible. It sends a command like "/myapplication/piano/anythinggoes 1" over the network, and it is up to the receiver to understand the commands.

Hence, for Paddy, we can send commands to edit pictures. All we need is to connect the receiver (Paddy) with the sender

For more, Wikipedia: http://en.wikipedia.org/wiki/Open_Sound_Control

Paddy OSC implementation

Effectively, when you switch on Paddy's OSC receiver in preferences/Basic Setup, Paddy starts to listen for incoming OSC commands on the PC's network connection. If the command is in the Paddy namespace, Paddy reacts. Once a device is connected to Paddy, Paddy also sends OSC commands out. This means that sliders on the IPad (in the OSC implementation) move.

Ports

Paddy uses the following for OSC

- Paddy listens on port: 8000

- Paddy is sending on port: 9000

Paddy OSC namespace

Paddy is listening and sending in the namespace

/Paddy/Lightroom/

Any other command is ignored

Paddy OSC commands


Slider

Command: /Paddy/Lightroom/slidernumber/[slider number] [percent setting]

in/out: Sending and receiving

Parameters

slider number
Paddy internal slider number. The list of sliders and associated numbers is available here

percent setting
between 0 and 1, with decimals. The setting of the slider in percent of the full range. E.g., .666 = 66.6% . This is to be compatible with future Lightroom versions and to translate the temperature for raw pictures into a linear scale for a controller (the LR sldier for Temperatur in raw is non linerar)

Example

/Paddy/Lightroom/slidernumber/5 .5

sets the exposure slider in the middle of the available range

How to use Create a slider or a rotary controller that reacts to the slider number you want to influence. Make sure the range is 0 to 100

Notes

Paddy adjusts for the process and picture type. E.g., 50% in Exposure is the mid point in JPG, raw, 2010, 2012


Presets

Apply

Command: /Paddy/Lightroom/preset/[preset number] 1

in/out: Receiving

Parameters

Preset number
The number of the preset that Paddy should apply (see below). Currently supported: 1-10, 1001-1010, 2001-2010

1
if "1", preset is applied. Otherwise, ignored

Example

/Paddy/Lightroom/preset/1002 1

Applies preset number 2 of the second Paddy OSC preset bank

How to use

Create a button that send the appropriate command for the preset. See next section for the label

Notes Paddy organizes the presets available for OSC at the moment in in 3 sets with 10 presets each. See the Paddy user guide for more. In effect, the user associates a preset number with a certain preset. If Paddy receives the preset number with this command, the preset is applied


Name in OSC interface

Command: /Paddy/Lightroom/preset_name/[preset number] [string]

in/out: Sending

Parameters

Preset number
The number of the preset that the user named. Currently supported: 1-10, 1001-1010, 2001-2010

[string]
the name the user gave the preset

Example

/Paddy/Lightroom/preset_name/1002 B&W setting 1

The user named the OSC preset #2 in the second bank as "B&W setting 1"

Notes Paddy organizes the presets available for OSC at the moment in in 3 sets with 10 presets each. See the Paddy user guide for more. In effect, the user associates a preset number with a certain preset.

Paddy sends this command when a OSC device connects for all OSC Presets the user assigned. This enables the OSC interface to rename the button. Practically speaking, the label on your button for an OSC preset should react to this command and change when it is received


Hide/show

Commands: /Paddy/Lightroom/preset/[preset number]/visible [0|1]

/Paddy/Lightroom/preset_name/[preset number]/visible [0|1]

in/out: Sending

Parameters

Preset number
The number of the preset that the user named. Currently supported: 1-10, 1001-1010, 2001-2010

0,1
0 means the preset is not in use and the user interface can hide the button ; 1 means it is in use

Example

/Paddy/Lightroom/preset_name/1002/visible 0

The user has not mapped preset 1002 and it can be hidden in the interface

Notes Paddy organizes the presets available for OSC at the moment in in 3 sets with 10 presets each. See the Paddy user guide for more. In effect, the user associates a preset number with a certain preset.

Paddy sends this command when a OSC device connects for all OSC Presets the user assigned. This enables the OSC interface to show or hide the buttons

Practically speaking, TouchOSC does this automagically when an OSC command is assigned. In other words, in TouchOSC, if you create a button that has the associated OSC command "/Paddy/Lightroom/preset/1002", it will send the command when touched, hide when it receives "/Paddy/Lightroom/preset/1002/visible 0", and show when it receives "/Paddy/Lightroom/preset/1002/visible 1". The same is true for a label with the associated OSC command "/Paddy/Lightroom/preset_name/1002"


Camera Profiles

Apply

Command: /Paddy/Lightroom/profile/[profile number] 1

in/out: Receiving

Parameters

profile number
The number of the profile that Paddy should apply (see below). Currently supported: 1-10, 1001-1010, 2001-2010

1
if "1", profile is applied. Otherwise, ignored

Example

/Paddy/Lightroom/profile/1002 1

Applies profile number 2 of the second Paddy OSC profile bank

How to use

Create a button that send the appropriate command for the preset. See next section for the label

Notes

Paddy organizes camera profiles available for OSC at the moment in in 3 sets with 10 profiles each. See the Paddy user guide for more. In effect, the user associates a profile number with a certain profile. If Paddy receives the profile number with this command, the profile is applied


Name in OSC interface

Command: /Paddy/Lightroom/profile_name/[profile number] [string]

in/out: Sending

Parameters

profile number
The number of the profile that the user named. Currently supported: 1-10, 1001-1010, 2001-2010

[string]
the name the user gave the profile

Example

/Paddy/Lightroom/profile_name/1002 Adobe standard

The user mapped the OSC profile #2 in the second bank to "Adobe Standard"

Notes Paddy organizes the profiles available for OSC at the moment in in 3 sets with 10 profiles each. See the Paddy user guide for more. In effect, the user associates a profile number with a certain profile.

Paddy sends this command when a OSC device connects for all OSC profiles the user assigned. This enables the OSC interface to rename the button. Practically speaking, the label on your button for an OSC profile should react to this command and change when it is received


Hide/show

Commands: /Paddy/Lightroom/profile/[profile number]/visible [0|1]

/Paddy/Lightroom/profile_name/[profile number]/visible [0|1]

in/out: Sending

Parameters

profile number
The number of the profile that the user named. Currently supported: 1-10, 1001-1010, 2001-2010

0,1
0 means the profile is not in use and the user interface can hide the button ; 1 means it is in use

Example

/Paddy/Lightroom/profile_name/1002/visible 0

The user has not mapped profile 1002 and it can be hidden in the interface

Notes Paddy organizes the profiles available for OSC at the moment in in 3 sets with 10 profiles each. See the Paddy user guide for more. In effect, the user associates a profile number with a certain profile.

Paddy sends this command when a OSC device connects for all OSC profiles the user assigned. This enables the OSC interface to show or hide the buttons

Practically speaking, TouchOSC does this automagically when an OSC command is assigned. In other words, in TouchOSC, if you create a button that has the associated OSC command "/Paddy/Lightroom/profile/1002", it will send the command when touched, hide when it receives "/Paddy/Lightroom/profile/1002/visible 0", and show when it receives "/Paddy/Lightroom/profile/1002/visible 1". The same is true for a label with the associated OSC command "/Paddy/Lightroom/profile_name/1002"


Keywords

Apply

Command: /Paddy/Lightroom/keyword/[keyword number] 1

in/out: Receiving

Parameters

keyword number
The number of the keyword that Paddy should apply (see below). Currently supported: 1-70, 1001-1070, 2001-2070...7001-7070

1
if "1", keyword is applied. Otherwise, ignored

Example

/Paddy/Lightroom/keyword/1002 1

Applies keyword number 2 of the second Paddy OSC keyword bank

How to use

Create a button that send the appropriate command for the preset. See next section for the label

Notes Paddy organizes keywords available for OSC at the moment in in 7 sets with 70 keywords each. See the Paddy user guide for more. In effect, the user associates a keyword number with a certain keyword. If Paddy receives the keyword number with this command, the keyword is applied


Name in OSC interface

Command: /Paddy/Lightroom/keyword_name/[keyword number] [string]

in/out: Sending

Parameters

keyword number
The number of the keyword that the user named. Currently supported: 1-70, 1001-1070, 2001-2070...7001-7070

[string]
the keyword the user associated with this number

Example

/Paddy/Lightroom/keyword_name/1002 Grandpa

The user mapped the OSC keyword #2 in the second bank to "Grandpa". This is the "leaf" of the LR keyword tree. In other words, this will say "Grandpa" for family-->grandpa as well as for "character-->grandpa"

Notes Paddy organizes the keywords available for OSC at the moment in in 7 sets with 70 keywords each. See the Paddy user guide for more. In effect, the user associates a keyword number with a certain keyword.

Paddy sends this command when a OSC device connects for all OSC keywords the user assigned. This enables the OSC interface to rename the button. Practically speaking, the label on your button for an OSC keyword should react to this command and change when it is received


Hide/show

Commands: /Paddy/Lightroom/keyword/[keyword number]/visible [0|1]

/Paddy/Lightroom/keyword_name/[keyword number]/visible [0|1]

in/out: Sending

Parameters

keyword number
The number of the keyword that the user named. Currently supported: 1-70, 1001-1070, 2001-2070...7001-7070

0,1
0 means the keyword is not in use and the user interface can hide the button ; 1 means it is in use

Example

/Paddy/Lightroom/keyword_name/1002/visible 0

The user has not mapped keyword 1002 and it can be hidden in the interface

Notes Paddy organizes the keywords available for OSC at the moment in in 7 sets with 70 keywords each. See the Paddy user guide for more. In effect, the user associates a keyword number with a certain keyword.

Paddy sends this command when a OSC device connects for all OSC keywords the user assigned. This enables the OSC interface to show or hide the buttons

Practically speaking, TouchOSC does this automagically when an OSC command is assigned. In other words, in TouchOSC, if you create a button that has the associated OSC command "/Paddy/Lightroom/keyword/1002", it will send the command when touched, hide when it receives "/Paddy/Lightroom/keyword/1002/visible 0", and show when it receives "/Paddy/Lightroom/keyword/1002/visible 1". The same is true for a label with the associated OSC command "/Paddy/Lightroom/keyword_name/1002"


LR Commands

Command: /Paddy/Lightroom/function/[function number]

in/out: receiving

Parameters

function number
The number of the Paddy function to execute in Lightroom. The list of functions and function numbers is available here . NOTE: You cannot apply presets, camera profiles etc this way

Example

/Paddy/Lightroom/function/1214

function: "Sharpening - (Large)" Moves the sharpen slider by a large amount as defined by the user in paddy

Notes This is the key to all the power of Paddy. Anything in LR goes, as long as it has function number.

The best way to find a function is to let Paddy show you: Goto Preferences-Basic settings->Debug tab and click "show function number in keyboard gui". When you assign a keyboard key, the function number will be displayed


Connecting

Command: /Paddy/Lightroom/connect

in/out: receiving

Parameters

none

Example

/Paddy/Lightroom/connect

Notes When Paddy receives this command, it saves the IP address as the address for the OSC device and displays a small menu. Paddy then sends

/Paddy/Lightroom/connect/visible 0

/Paddy/Lightroom/connect/visible 1

in reasonable intervals. This makes the connect button blink and is a sign that the connection was made successfully.


User interface

Commands:

/Paddy/Lightroom/keyword_set_name/[set number] [string]

/Paddy/Lightroom/keyword_set/[set number]

/Paddy/Lightroom/preset_set/[set number]

/Paddy/Lightroom/camera_tab

in/out: Sending

Parameters

Set number
Number of the keyword or preset to move to/to change the name

string
New name of the set

Example

/Paddy/Lightroom/keyword_set_name/2 Family

Changes the name of the keyword set #2

/Paddy/Lightroom/preset_set/3 In the Paddy user interface, user chose preset set #2

How to use If you use several tabs for presets, have the tab react to /preset_set/[number]

If you use keyword tabs, have the tabs react to /keyword_set/[number] and the label of the tab to /keyword_set_name/[number]

Notes These commands are used to sync the IPad interface with the computer interface. When the user selects a tab in the standard Paddy interface, Paddy sends the appropriate command. Similarly, when a user changes the name of the tab, Paddy sends out the ne wname

Note that these commands are editable in Paddy. This set just represents the default.


Interacting via windows messages to Paddy

Paddy can react to windows messages sent.

General idea

Windows applications can received messages through the windows system. To Paddy, it doesn't matter who sends this message. So you could write a C# app that manipulates Lightroom, using Paddy as the interface into LR

example code

This is a c# demo code

__

// header to import the required functions
[DllImport("user32.dll", SetLastError = true)]
       static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
       static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
 private IntPtr _paddyHandle; // handle to Paddy

 private static void execute_paddy_function(int functionnumber)
 {
 // sends message to Paddy to execute a function
 SendMessage(PaddyHandle, 0x4005, functionnumber, 0);
}

 private IntPtr PaddyHandle
       {
           get
           {
               //If we haven't gotten the handle to Paddy yet
               if (_paddyHandle.ToInt32() == 0)
               {
                   //look it up now and save it for future calls.
                   _paddyHandle = FindWindow(null, "Paddy.exe");
                   Debug.WriteLine(string.Format("Paddyhandle = {0}", (uint)_paddyHandle));
               }
               return _paddyHandle;
           }
       }

__

LR commands

Message number: 0x4005

Parameters

WParam
The number of the Paddy function to execute in Lightroom. The list of functions and function numbers is available here . NOTE: You cannot apply presets, camera profiles etc this way

LParam
Unused

Example

SendMessage(PaddyHandle, 0x4005, 1214, 0);

function: "Sharpening - (Large)" Moves the sharpen slider by a large amount as defined by the user in paddy

Notes This is the key to all the power of Paddy. Anything in LR goes, as long as it has function number.

The best way to find a function is to let Paddy show you: Goto Preferences-Basic settings->Debug tab and click "show function number in keyboard gui". When you assign a keyboard key, the function number will be displayed


Set a slider

Message number: 0x4006

Parameters

WParam
Paddy internal slider number. The list of sliders and associated numbers is available here

LParam
Integer for slider position between 0 and 10000. Represents the slider position to move to in percent of the full range times 100: [percent]*100.

For instance, 10000 = 100%; 9950 = 99.50, etc. This is to be compatible with future Lightroom versions and to translate the temperature for raw pictures into a linear scale for a controller (the LR slider for Temperature in raw is non linear)

Example

SendMessage(PaddyHandle, 0x4006, 1214, 5000);

sets the exposre slider in the middle of the available range

Notes

Paddy adjusts for the process and picture type. E.g., 50% in Exposure is the mid point in JPG, raw, 2010, 2012


Apply a preset

Apply a camera profile

Apply a keyword


Related

Wiki: Main_Page