<commit_before>//
//  main.cpp
//  projectM-sdl
//
//  Created by <NAME> on 6/3/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//
//  This is an implementation of projectM using libsdl2


#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <SDL2/SDL.h>
#include <CoreAudio/CoreAudio.h>
#endif

#include <projectM.hpp>
#include <iostream>
const float FPS = 60;

typedef struct {
    projectM *pm;
    SDL_Window *win;
    SDL_Renderer *rend;
    bool done;
    projectM::Settings settings;
    SDL_AudioDeviceID audioInputDevice;
} projectMApp;

int selectAudioInput(projectMApp *app) {
    // audio input stuff here is very platform-specific
    // too bad the libsdl2 audio capture support doesn't exist

    #ifdef __APPLE__
UInt32 audioInputIsAvailable;
UInt32 propertySize = sizeof (audioInputIsAvailable);
 
AudioSessionGetProperty (
    kAudioSessionProperty_AudioInputAvailable,
    &propertySize,
    &audioInputIsAvailable // A nonzero value on output means that
                           // audio input is available
);

    #endif

    return 1;
}

void renderFrame(projectMApp *app) {
    int i;
    short pcm_data[2][512];
    SDL_Event evt;
    
    SDL_PollEvent(&evt);
    switch (evt.type) {
        case SDL_KEYDOWN:
            // ...
            break;
        case SDL_QUIT:
            app->done = true;
            break;
    }


//        projectMEvent evt;<commit_msg>need to deal with coreaudio<commit_after>//
//  main.cpp
//  projectM-sdl
//
//  Created by <NAME> on 6/3/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//
//  This is an implementation of projectM using libsdl2


#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <SDL2/SDL.h>
#include <CoreAudio/CoreAudio.h>
#endif

#include <projectM.hpp>
#include <iostream>
const float FPS = 60;

typedef struct {
    projectM *pm;
    SDL_Window *win;
    SDL_Renderer *rend;
    bool done;
    projectM::Settings settings;
    SDL_AudioDeviceID audioInputDevice;
} projectMApp;

int selectAudioInput(projectMApp *app) {
    // audio input stuff here is very platform-specific
    // too bad the libsdl2 audio capture support doesn't exist

    #ifdef __APPLE__
// UInt32 audioInputIsAvailable;
// UInt32 propertySize = sizeof (audioInputIsAvailable);
 
// AudioSessionGetProperty (
//     kAudioSessionProperty_AudioInputAvailable,
//     &propertySize,
//     &audioInputIsAvailable // A nonzero value on output means that
//                            // audio input is available
// );

    #endif

    return 1;
}

void renderFrame(projectMApp *app) {
    int i;
    short pcm_data[2][512];
    SDL_Event evt;
    
    SDL_PollEvent(&evt);
    switch (evt.type) {
        case SDL_KEYDOWN:
            // ...
            break;
        case SDL_QUIT:
            app->done = true;
            break;
    }


//        projectMEvent evt;
{'fraction_non_alphanumeric': 0.10296191819464035, 'fraction_numerical': 0.015514809590973202, 'mean_word_length': 2.455542021924482, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1352890', 'n_tokens_mistral': 954, 'n_tokens_neox': 890, 'n_words': 247}