text
stringlengths 0
2.2M
|
---|
}
|
void liftClosures(Block* block) {
|
for (auto it = block->nodes().begin(); it != block->nodes().end();) {
|
Node* n = *it;
|
it++;
|
switch (n->kind()) {
|
case prim::Closure: {
|
liftClosure(n);
|
} break;
|
default: {
|
for (Block* b : n->blocks()) {
|
liftClosures(b);
|
}
|
}
|
}
|
}
|
}
|
void liftClosures(const std::shared_ptr<Graph>& to_clean) {
|
liftClosures(to_clean->block());
|
}
|
} // namespace jit
|
} // namespace torch
|
/*
|
AY module for SoLoud audio engine
|
Copyright (c) 2020 Jari Komppa
|
This software is provided 'as-is', without any express or implied
|
warranty. In no event will the authors be held liable for any damages
|
arising from the use of this software.
|
Permission is granted to anyone to use this software for any purpose,
|
including commercial applications, and to alter it and redistribute it
|
freely, subject to the following restrictions:
|
1. The origin of this software must not be misrepresented; you must not
|
claim that you wrote the original software. If you use this software
|
in a product, an acknowledgment in the product documentation would be
|
appreciated but is not required.
|
2. Altered source versions must be plainly marked as such, and must not be
|
misrepresented as being the original software.
|
3. This notice may not be removed or altered from any source
|
distribution.
|
*/
|
#include <stdlib.h>
|
#include <stdio.h>
|
#include <string.h>
|
#include <math.h>
|
#include "sndbuffer.h"
|
#include "sndrender.h"
|
#include "sndchip.h"
|
#include "chipplayer.h"
|
#include "soloud_ay.h"
|
#include "soloud_file.h"
|
#include "zx7decompress.h"
|
namespace SoLoud
|
{
|
AyInstance::AyInstance(Ay *aParent)
|
{
|
mPos = 0;
|
mParent = aParent;
|
mChip = new ChipPlayer(this);
|
}
|
unsigned int AyInstance::getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int /*aBufferSize*/)
|
{
|
int samples = mChip->play(aBuffer, aSamplesToRead);
|
return samples;
|
}
|
bool AyInstance::hasEnded()
|
{
|
return mParent->mLength <= mPos;
|
}
|
result AyInstance::rewind()
|
{
|
mPos = 0;
|
return SO_NO_ERROR;
|
}
|
float AyInstance::getInfo(unsigned int aInfoKey)
|
{
|
if ((aInfoKey & 0xf) <= 13)
|
{
|
if (aInfoKey < 0x10)
|
return mChip->chip.get_reg(aInfoKey);
|
if (aInfoKey & 0x10)
|
return mChip->chip2.get_reg(aInfoKey & 0xf);
|
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.