Giter Site home page Giter Site logo

Any way for shorter time about animatedgif HOT 7 CLOSED

mm12 avatar mm12 commented on September 23, 2024
Any way for shorter time

from animatedgif.

Comments (7)

Waitsnake avatar Waitsnake commented on September 23, 2024 1
  1. Download and install Xcode from the AppStore.
  2. Clone project from Github to a local folder on your computer.
  • a) Can be done on your project page by pressing the green "Clone or download" button an unzip the file.

  • b) Or type in the terminal app: git clone https://github.com/mm12/AnimatedGif.git

  1. In your downloaded local project folder double click on AnimatedGif.xcodeproj to open the project in Xcode.
  2. In Xcode click in menu on "Product->Build For->Running" and wait until project is compiled.
  3. In Xcode on the left in the project tree window find the entry "AnimatedGif->Products->AniamtedGif.saver" and right click on it for context menu and in context menu click on "open in finder". A finder window should open already in the path were the compiled saver file is located.

from animatedgif.

Waitsnake avatar Waitsnake commented on September 23, 2024

Actually I also experimented in early versions with different change intervals also with seconds instead of minutes. But using a fraction of second instead of a minute as base of the change slider limits also the possible maximum. For example using a 15 seconds interval and having 30 different positions in the slider set the maximum value to 7.5 minutes. Using a 5 sec and you end up with 2,5 minutes as maximum.
Finally I thought that very short change intervals are mostly relevant for playing around with the software when it is new and later nobody will mind short intervals and longer intervals become more relevant. And so I ended up with values between 1 minute to 29 minutes and a special value "never".

Anyway if you do not like that decision the software is open source and you can make a fork and easily change the interval to any value you like.
I know this was done before form an other person on Github as you see here (it is based on an older version of AnimatedGif): eokuwwy@9486816

from animatedgif.

mm12 avatar mm12 commented on September 23, 2024

How would I implement a counter so it counts the number of times and then changes?
I just need to know if it has those variables.

from animatedgif.

Waitsnake avatar Waitsnake commented on September 23, 2024

The time for changing is permanently stored(even when screensaver is not running) in the ScreenSaverDefaults class and can accessed by the key @"ChangeInterval".

E.g. during startAnimation() it is loaded from this default class into the variable "changeIntervalInMin":
NSInteger changeIntervalInMin = [defaults integerForKey:@"ChangeInterval"];

The variable changeIntervalInMin is than used to start the timer:
changeTimer = [NSTimer scheduledTimerWithTimeInterval:(changeIntervalInMin * 60) target:self selector:@selector(timerMethod) userInfo:nil repeats:NO];

Those "60" is there to convert the value from minutes to seconds. The most easy way to change it would be to replace this "60" with a "1" and then the GIFs will change in a seconds and not minutes.

from animatedgif.

Waitsnake avatar Waitsnake commented on September 23, 2024

But if you like to count the number of times an GIF is played (or looped) you need to know when the last frame is drawn and it jumps back the frame 1 of the GIF.

This is done in timerAnimateOneFrame().
//calculate next frame of GIF to show if (currFrameCount < maxFrameCount-1) { currFrameCount++; } else { currFrameCount = FIRST_FRAME; }

The else-case where the setting of the frame counter back to FIRST_FRAME is done is a good place implement a counter how often the GIF has looped.

When you reach your desired number of change intervals (maybe loading a value from the default class like @"ChangeInterval") you can do the same steps that are done in the timerMethod().

- (void)timerMethod { // after change timer is running out this method is called // the animation of last GIF is stopped an memory cleaned, but without destroying GL view or telling the screensaver engine about it (no call of super method; handled by trigByTimer=TRUE) trigByTimer = TRUE; [self stopAnimation]; // the animation is start again witch randomly pics a new GIF from folder and start the change timer again, but without telling the screensaver engine about it (no call of super method; handled by trigByTimer=TRUE) [self startAnimation]; trigByTimer = FALSE; }

The easy way would be just call timerMethod() when you will switch to another GIF. Don't forget to comment out the start of the changeTimer mentioned in my previous post otherwise also the timer will change the GIF when he is running out.

from animatedgif.

mm12 avatar mm12 commented on September 23, 2024

how do i actually turn it into a .saver?

from animatedgif.

Waitsnake avatar Waitsnake commented on September 23, 2024

Closed because submitter try make his feature request in an own fork.

from animatedgif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.