Skip to content

Commit

Permalink
add format text move
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Oct 3, 2021
1 parent 6491783 commit 7aab144
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(move-transition VERSION 2.5.0)
project(move-transition VERSION 2.5.1)
set(PROJECT_FULL_NAME "Move Transition")

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
Expand Down
6 changes: 6 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ MoveValueType="Move Value Type"
MoveValueType.SingleSetting="Single Setting"
MoveValueType.Settings="Settings"
MoveValueType.Random="Random"
MoveValueType.SettingAdd="Add"
FormatType="Format Type"
FormatType.Decimals="Decimals number"
FormatType.Float="Float format using printf"
FormatType.Time="Time format using strftime"
Format="Format"
Settings="Settings"
Setting="Setting"
Setting.None="None"
Expand Down
1 change: 1 addition & 0 deletions installer.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir="@ISS_FILES_DIR@"
OutputBaseFilename=@PROJECT_NAME@-installer
DirExistsWarning=no
; Wizard Information
WizardStyle=modern
WizardResizable=yes
Expand Down
2 changes: 1 addition & 1 deletion move-source-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ static obs_properties_t *move_source_properties(void *data)
100);
obs_property_int_set_suffix(p, "ms");
obs_properties_t *duration = obs_properties_create();
p = obs_properties_add_int(duration, S_DURATION, "", 10, 100000, 100);
p = obs_properties_add_int(duration, S_DURATION, "", 10, 10000000, 100);
obs_property_int_set_suffix(p, "ms");
p = obs_properties_add_group(group, S_CUSTOM_DURATION,
obs_module_text("CustomDuration"),
Expand Down
5 changes: 2 additions & 3 deletions move-transition.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "move-transition.h"
#include <obs-module.h>
#include <../UI/obs-frontend-api/obs-frontend-api.h>
#include "../obs-transitions/easings.h"
#include "graphics/math-defs.h"
#include "graphics/matrix4.h"
#include "easing.h"
Expand Down Expand Up @@ -2146,13 +2145,13 @@ static void move_video_render(void *data, gs_effect_t *effect)
static float mix_a(void *data, float t)
{
UNUSED_PARAMETER(data);
return 1.0f - cubic_ease_in_out(t);
return 1.0f - CubicEaseInOut(t);
}

static float mix_b(void *data, float t)
{
UNUSED_PARAMETER(data);
return cubic_ease_in_out(t);
return CubicEaseInOut(t);
}

static bool move_audio_render(void *data, uint64_t *ts_out,
Expand Down
14 changes: 13 additions & 1 deletion move-transition.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#define S_SETTING_FLOAT_MIN "setting_float_min"
#define S_SETTING_FLOAT_MAX "setting_float_max"
#define S_SETTING_DECIMALS "setting_decimals"
#define S_SETTING_FORMAT_TYPE "setting_format_type"
#define S_SETTING_FORMAT "setting_format"
#define S_SETTING_COLOR "setting_color"
#define S_SETTING_COLOR_MIN "setting_color_min"
#define S_SETTING_COLOR_MAX "setting_color_max"
Expand Down Expand Up @@ -159,6 +161,10 @@
#define MOVE_VALUE_COLOR 3
#define MOVE_VALUE_TEXT 4

#define MOVE_VALUE_FORMAT_DECIMALS 0
#define MOVE_VALUE_FORMAT_FLOAT 1
#define MOVE_VALUE_FORMAT_TIME 2

#define NEXT_MOVE_ON_END 0
#define NEXT_MOVE_ON_HOTKEY 1
#define NEXT_MOVE_REVERSE "Reverse"
Expand Down Expand Up @@ -201,6 +207,7 @@
#define MOVE_VALUE_TYPE_SINGLE_SETTING 0
#define MOVE_VALUE_TYPE_SETTINGS 1
#define MOVE_VALUE_TYPE_RANDOM 2
#define MOVE_VALUE_TYPE_SETTING_ADD 3

struct move_value_info {
obs_source_t *source;
Expand All @@ -227,30 +234,35 @@ struct move_value_info {
long long easing_function;

long long int_to;
long long int_value;
long long int_from;
long long int_min;
long long int_max;

int decimals;
double double_to;
double double_value;
double double_from;
double double_min;
double double_max;

struct vec4 color_to;
struct vec4 color_value;
struct vec4 color_from;
struct vec4 color_min;
struct vec4 color_max;

obs_data_array_t *settings;

long long move_value_type;
long long value_type;
long long format_type;
char *format;
DARRAY(obs_source_t *) filters_done;

long long next_move_on;
bool reverse;
bool enabled_match_moving;
bool random;
};

struct move_source_info {
Expand Down
Loading

0 comments on commit 7aab144

Please sign in to comment.